Nonadiabatic holonomic quantum computation has received increasing attention due to its robustness against control errors. However, all the previous schemes have to use at least two sequentially implemented gates to realize a general one-qubit gate. Based on two recent works [1, 2], we construct two Hamiltonians and experimentally realized nonadiabatic holonomic gates by a single-shot implementation in a two-qubit nuclear magnetic resonance (NMR) system. Two noncommuting one-qubit holonomic gates, rotating alongx andẑ axes respectively, are implemented by evolving a work qubit and an ancillary qubit nonadiabatically following a quantum circuit designed. Using a sequence compiler developed for NMR quantum information processor, we optimize the whole pulse sequence, minimizing the total error of the implementation. Finally, all the nonadiabatic holonomic gates reach high unattenuated experimental fidelities over 98%.