Efficient immune response often depends on the production of high affinity antibodies. We show analytically that the optimal strategy for a fast production of high affinity antibodies is to utilize a step-function mutation rate, i.e. a minimal mutation rate in early stages of the immune response, followed by a discontinuous switch to the maximal possible rate when the proliferating population of B-cells exceeds a threshold value. Our results are in accordance with the biological observations concerning the time of onset of the hypermutation process, and with the mutation rate during the later stages of the primary immune response. Indeed the hypermutation process plays a crucial role in responding to a prevailing pathogen at each round of immune response, and not only for coping with future infections. Moreover, as the effect of hypermutations is shown to be crucially dependent on the number of proliferating B-cells, its onset is not expected to depend on an external signal, but rather to be related to the clone's age. This suggests that the onset is host species specific, rather than pathogen specific. Another implication of the present results is that activation of hypermutations before the B-cell population has reached the critical size may impede the efficiency of the response.