Ag/g-C3N4 composite was firstly used for catalytic reduction of 4-nitrophenol. Ag/g-C3N4 composite exhibited excellent catalytic activity. A synergistic effect and interaction of Ag NPs with g-C3N4 was studied. A catalytic mechanism of composite under different conditions was elucidated.