As one of the most abused illicit drugs, ketamine (KET) has been widely detected in different water environments around the globe, which necessitates the development of effective approaches for KET removal from water. In the present study, several novel Ag 3 PO 4 /P-g-C 3 N 4 heterojunction composites were successfully constructed using an in situ growth method, and the samples were characterized by a series of instruments. The synthesized samples were deployed for KET degradation. Results showed that Ag 3 PO 4 / P-g-C 3 N 4 (1:1) exhibited the most excellent photocatalytic degradation performance on KET with a pseudo-first-order rate constant of 0.0326 min −1 at a neutral pH value, which was 3-and 6-fold faster than those of Ag 3 PO 4 and P-g-C 3 N 4 , respectively. The elevated photocatalytic performance of Ag 3 PO 4 /P-g-C 3 N 4 was attributed to the synergistic effects of the high charge separation capacity and Z-scheme heterojunction structure. Low concentrations of dissolved organic matter, nitrate, or bicarbonate accelerated KET degradation by Ag 3 PO 4 /P-g-C 3 N 4 , but high levels of these constituents would inhibit KET degradation. The scavenging experiments revealed that photogenerated superoxide radicals and holes were the main reactive species in the KET removal. A total of 12 degradation intermediates of KET over Ag 3 PO 4 /P-g-C 3 N 4 were identified, and a possible degradation pathway was proposed. Demethylation, dehydrogenation, hydroxylation, deamination, ring opening, and sodium modification were the major pathways for KET degradation. Ag 3 PO 4 /P-g-C 3 N 4 also exhibited a relatively good photocatalytic performance on KET degradation in surface water and a secondary effluent. KEYWORDS: Ag 3 PO 4 /P-g-C 3 N 4 , ketamine, degradation mechanism, intermediate, pathway