Palygorskite-rich mudstone interbedded with gypsum occurs in the Neogene Baiyanghe Formation in the Yangtaiwatan basin, northwest China, but the genesis of palygorskite in the mudstone is unclear. The objective of the present study was to clarify the manner by which the palygorskite evolved by analyzing the mineralogical and geochemical characteristics of the mudstone. The mineralogical composition of bulk-rock mudstone consisted of clay minerals, quartz, feldspar, dolomite, calcite, and gypsum. Palygorskite is dominant in the clay fraction together with illite and accessory chlorite and kaolinite. The interwoven rod-like palygorskite aggregates and delicate palygorskite particles indicated an authigenic origin. The bulk rock of palygorskite-rich mudstone was rich in the trace elements Cs, U, B, Li, Sb, Bi, and As, which, together with REE, all showed very positive correlation with major element oxides Al2O3, Fe2O3, MgO, K2O, and TiO2 of the mudstone, indicating that the REE and trace elements occurred mainly in the clay minerals. The detrital illite, chlorite, and kaolinite were the main original host of the REE and enriched trace elements. Statistical analyses showed that the authigenic palygorskite had strong affinity to such elements compared to the detrital clay minerals. In addition, the chondrite-normalized REE of the bulk mudstone showed essentially the same pattern irrespective of the proportions of detrital illite, kaolinite, chlorite, and authigenic palygorskite present in the samples. Thus, the conclusion reached was that palygorskite was generated from the dissolution of detrital clay minerals. The REE and enriched trace elements in authigenic palygorskite were inherited from the detrital clay minerals.