The feds are investigating a controversial Russian sports agent who’s suspected of paying bribes to get doped-up runners into major US races — including the New York City Marathon, it was revealed Thursday.

Undercover agents even conducted surveillance of Andrey Baranov’s Upper West Side apartment building during the run-up to Sunday’s five-borough, 26.2-mile competition, the New York Times reported.

No runners from Russia will take part in the race due to the doping scandal that barred more than 100 of the country’s athletes from this year’s Olympics in Rio de Janeiro, the Times said.

The probe of Baranov is focused on possible racketeering and money laundering by him and unidentified American race organizers over the past several years, according to the report.

The investigation reportedly involves both the FBI and the Brooklyn US Attorney’s Office, which last year filed corruption chagres against top international soccer officials, resulting in 18 convictions so far.

Baranov, 50, founded the Spartanik RS sports-management agency in 2003 “to bring the dominance of Eastern-European Athletes at the Olympic Competitions of 1980’s back to the highest level,” according to its Facebook page.

But at least two of his clients have been caught using banned performance-enhancers, including Lyubov Denisova, who came in second among the women in the 2002 New York City Marathon.

She also ran the 2006 Honolulu marathon in a record 2 hours, 27 minutes and 19 seconds, but later tested positive for elevated levels of testosterone and was banned from the sport for two years.

Baranov was hailed as a whistleblower for telling the International Association of Athletics Federation that two Russian athletic officials shook down another crooked client, Liliya Shobukhova, for $550,000 so she could compete in the 2012 Olympics in London, where she failed to finish.

But a February ruling from the IAAF Ethics Commission noted that the All-Russia Athletic Federation lodged a complaint against Baranov, with one of its coaches noting his “disgusting reputation in the world of athletics.”

Baranov — who has run the New York City Marathon six times — told the Times he denied any wrongdoing and later refused to comment to The Post.

In a statement, the New York Road Runners, organizers of the city’s marathon, said it was ”deeply committed to a clean sport.”

“If contacted, we will cooperate fully with authorities,” the statement added.

Additional reporting by Reuven Fenton