Parks maintenance worker Andre Jenkins, 36, said he was caught urinating in June in an empty parking lot in East New York after a two-hour train ride home from work.
"I had to go real bad. I thought it was a safe spot -- but a cop showed up out of nowhere. It was like he fell out of the sky," he said.
He got a public-urination ticket, which can carry a $50 fine, the New York Post reported Sunday.
Judge Sharen Hudson tossed the ticket Friday during Brooklyn District Attorney Charles Hynes' Project Safe Surrender, a program meant to eliminate low-level warrants and summonses so prosecutors can focus on more serious crimes.
The event was held at St. Augustine's Episcopal Church in East Flatbush.
"It's a beautiful thing," said Jenkins, who had one of about 170 citations tossed Friday.