Surface-enhanced Raman scattering (SERS) in practical application and theoretical research mostly depends on the performance of the SERS substrate. In this study, a new SERS substrate which is based on inverted self-assembly of Ag nanoparticles (AgNPs) on glycidyl methacrylate-ethylene dimethacrylate (GMA-EDMA) porous material is developed. The characterization results show the GMA-EDMA material with intertwined pores may contribute to the distribution of the AgNPs to fabricate an ideal substrate for SERS detection. In view of the characteristics of porous material, an inverted assembly method is proposed and used in operation to avoid the adverse gravity effect which may make the AgNPs plug up the pore channel and distribute on the surface unevenly. By the inverted self-assembly method, the AgNPs could uniformly distribute on the surface of the material stably. The prepared substrate presents ultrasensitivity and good reproducibility for SERS detection. The enhancement factor of rhodamine 6G (R6G) detection is approximately 1014 and the relative standard deviation of each characteristic peak is about 15% when the substrate is used. The substrate also shows a good performance in detecting paraquat and thymine. The ultrasensitive SERS substrate can be readily integrated into pesticide detection systems and biological sample analysis. Copyright © 2013 John Wiley & Sons, Ltd.