This was far from a stroke of genius.

Kevin Fant, 44, a Transit Police Officer, was placed on administrative leave today after he was literally caught with his pants down, Jerri Williams, a SEPTA spokeswoman, said in a statement.

A video of Fant allegedly masturbating on a subway train reached SEPTA's administration last week, according to Transit Police Chief Thomas Nestel.

The footage, recorded in August on a Broad Street Line train, shows Fant getting in touch with himself while off-duty. Members of SEPTA's social-media department found the clip while doing a routine search of online postings mentioning the transit authority, said Nestel.

After a Transit Police captain viewed the video and positively identified Fant, the department took "immediate action," said Nestel.

Investigators obtained a search warrant for Fant's home, where they found clothing matching what he was allegedly wearing in the video.

"This is disgusting and shameful," Nestel said, "but I'm proud of fact that Transit Police detected the problem, investigated the problem and made the arrest of one of their own for criminal activity."

Fant, a 12-year veteran of the department working as a bike-patrol officer, faces indecent exposure and open lewdness charges, according to Williams. A warrant for his arrest has been approved by the District Attorney's Office, and he's expected to turn himself in to authorities tonight.

He faced a previous disciplinary charge in 2012, according to Nestel, but it had nothing to do with his activities this summer.

The transit authority has suspended Fant while it continues to investigate the case, said Williams.

But a source in SEPTA said that he's likely to lose his job, while going down in history as the first beat cop to get canned, for...you know...