A former San Antonio police officer who was fired in 2016 for giving a poop sandwich to a homeless man has successfully appealed the suspension.

Matthew Luckhurst (San Antonio Police Department)

Fellow officers reported that Matthew Luckhurst had put the feces between two slices of bread, put it in a discarded food container and left it near a homeless man while he was on bike patrol in May 2016.

Luckhurst argued that an injury would have prevented him from riding a bicycle that month, and an arbitrator overturned the dismissal because he wasn't punished within the required 180 days of the incident.

Luckhurst will remain off the job as he appeals another indefinite suspension, from November 2017, over a "prank" in which he and another officer trashed a women's restroom, left feces in the toilet and smeared a brown substance on the seat.

"This has taught me to stop acting childish and making stupid baseless jokes," Luckhurst wrote in a statement to investigators. "I need to stop the pranks and juvenile jokes to get arise [sic] or reaction from fellow officers and friends."

The Associated Press contributed to this report.