In geological exploration, it is necessary to analyze the geological history according to the rock types. But in places for people to reach, sample collection, and transportation is a costly task. At present, the remote intelligent detection of rock types needs to be further developed. In this study, laserinduced breakdown spectroscopy (LIBS), a sensitive optical technique that can rapidly analyze various elements, is applied to real-time detection and analysis of rock types. Representative rock samples and minerals are selected for spectral analysis and machine learning. The characteristic spectral lines of Ca, Al, Mg, Ti, Si, Na, Fe, K, and Li were observed in the spectra. By comparing the spectra of different samples, the differences among them were discussed.First, principal component analysis (PCA) is used for dimensionality reduction. With the help of PCA, the data are distributed in twodimensional and three-dimensional space and different kinds of rocks and minerals are classified successfully. Then, combined with error back propagation training artificial neural network, the rock and mineral identification model was established, and the recognition rate can reach 100%. The results show that LIBS is a powerful tool for remote intelligent realtime rock detection and classification, and has great application prospects in the exploration of extraterrestrial objects including planets, satellites and asteroids in the future.