SUMMARY The underground density and magnetic susceptibility structure obtained by cross-gradient inversion of gravity and magnetic data can provide an important basis for the evaluation of mineral resource potential. The inversion is realized by discretizing the subsurface into a series of cells and calculating the physical properties of each cell. This restricts the application in the inversion of large-area data because of the large memory usage and low computational efficiency owing to the large solution matrix. We proposed a high-efficiency cross-gradient inversion method of gravity and magnetic data based on function fitting, which uses a parametrized function to fit the physical properties of the central points of a number of cells in certain space based on the assumption that the physical property in each cell is uniform in the inversion. Therefore, the calculation of physical properties is replaced by the calculation of function coefficients. The number of cells that can be fitted by a function is more than the number of function coefficients. Thus, the new method requires less memory and can improve computational efficiency. In addition, with the function fitting method, the gradient terms can be directly obtained by the function coefficients instead of using the traditional central difference or multipoint fitting method, which could further improve the computational efficiency. The effectiveness and high computational efficiency of the proposed method were verified by model tests, and the accuracy of the inversion results was not lower than that of the traditional inversion method. We also proved that the proposed method is suitable for uniform hexahedral and unstructured tetrahedral cells. The real application area is located in eastern China and contains skarn-type magnetite deposits, which are characterized by high density and high magnetic susceptibility. The proposed method was used to obtain subsurface high-resolution density and magnetic susceptibility structures. We obtained the distribution range of mineral resources based on the ratio of density to magnetic susceptibility, which provides an important basis for further exploration. The model tests and real data applications show that the proposed method is more suitable for large-scale precise inversion and has better practicability.