Nickel-rich cathode materials have received widespread attention due to their high energy density. However, the poor rate capability and inferior cycle stability seriously hinder their large-scale application. The traditional co-precipitation method for preparing them has a long process and easily arises agglomeration leading to inhomogeneous element distribution. Here, a novel precursor containing Li element was prepared by ultrafast spray pyrolysis (SP) in 3-5 s. Then the precursor was used to synthesize pristine LiNi0.9Co0.05Mn0.05O2 (NCM90) and 1% Mg modified LiNi0.9Co0.05Mn0.05O2 (NCM90-Mg1). This method gets rid of mixing Li/Mg source and the precursor prepared by common co-precipitation, thus could achieve homogeneous lithiation and Mg2+ doping. The cell parameter c is expanded, and the cation disorder is reduced after Mg2+ doping. Furthermore, the harmful H2-H3 phase transition in NCM90-Mg1 is also well suppressed. As a result, the obtained NCM90-Mg1 shows better electrochemical performance than NCM90. Within 2.8-4.3 V (25 °C), the specific discharge capacity of NCM90-Mg1 at 5 C is as high as 169.1 mAh/g, and an outstanding capacity retention of 70.0% (10.0% higher than NCM90) can be obtained after 400 cycles at 0.5 C. At 45 °C, a capacity retention of 81.9% after 100 cycles at 1 C is recorded for NCM90-Mg1. Moreover, the NCM90-Mg1 also exhibits superior cycle stability when cycled at high cut-off voltage (4.5 V, 25 °C), possessing the capacity retention of 79.2% after 200 cycles at 1 C. Therefore, SP can be proposed as a powerful method for the preparation of multi-element materials for next-generation high energy density LIBs.