This ultrarunner’s career just went to s–t.

Kelly Agnew, an avid ultramarathon competitor, was stripped of some of his titles after an investigation revealed that he was hiding in a Port-a-Potty to win races.

The 45-year-old was disqualified at Across the Years, a fixed-time event in Arizona that takes place every new year, when he was spotted “registering laps without running the complete loop of the course,” according to a Facebook post Wednesday from race organizers.

He’s won the 48-hour race four times since his first medal in 2014 for running 201.5 miles in the 48-hour limit.

Officials said they were first suspicious of his performances after he won the 48-hour race by more than 55 miles in 2015 — even though he stopped running seven hours before it ended — and decided to track him during the multi-day looped course in Phoenix.

“He was witnessed circling back at the start/finish staging area after completing a lap, spending over 7 minutes in a portable restroom and then ‘completing’ the lap and going on for his next without actually running the mile plus loop,” organizers said.

Organizers took immediate action, approaching Agnew and asking him to turn over his racing bib.

They also announced that they were rescinding his first-place titles at four other races where he missed certain check-in points on the course. Agnew is banned from future races hosted by the organization.

According to Derek Murphy, a business analyst best known for busting cheating roadrunners on his blog marathoninvestigation.com, Agnew also missed checkpoints at the famous Leadville 100 and has questionable times recorded for other races as well.

At least one sponsor dropped Agnew after he was busted for cheating at the Across the Years race, Murphy reported.

“It saddens us to see this take place at an event that is centered around camaraderie amongst runners and support of top performances,” organizers said. “This type of cheating is not tolerated by our race or race organization.”