We experimentally investigate the protection of electron spin coherence of nitrogen vacancy (NV) center in diamond by dynamical nuclear polarization. The electron spin decoherence of an NV center is caused by the magnetic ield fluctuation of the $^{13}$C nuclear spin bath, which contributes large thermal fluctuation to the center electron spin when it is in equilibrium state at room temperature. To address this issue, we continuously transfer the angular momentum from electron spin to nuclear spins, and pump the nuclear spin bath to a polarized state under Hartman-Hahn condition. The bath polarization effect is verified by the observation of prolongation of the electron spin coherence time ($T_2^*$). Optimal conditions for the dynamical nuclear polarization (DNP) process, including the pumping pulse duration and depolarization effect of laser pulses, are studied. Our experimental results provide strong support for quantum information processing and quantum simulation using polarized nuclear spin bath in solid state systems.