Here we report the increase of the coherence time T 2 of a single-electron spin at room temperature by using dynamical decoupling. We show that the Carr-Purcell-Meiboom-Gill (CPMG) pulse sequence can prolong the T 2 of a single nitrogen-vacancy center in diamond up to 2.44 ms compared to the Hahn echo measurement where T 2 = 400 μs. Moreover, by performing spin-locking experiments we demonstrate that with CPMG the maximum possible T2 is reached. On the other hand, we do not observe a strong increase of the coherence time in nanodiamonds, possibly due to the short spin-lattice relaxation time T1 = 100 μs (compared to T 1 = 5.93 ms in bulk). An application for detecting low magnetic fields is demonstrated, where we show that the sensitivity using the CPMG method is improved by about a factor of 2 compared to the Hahn echo method.