Jim Walden has suspended his campaign for New York City mayor, his camp announced Tuesday.

“For months I have been steadfast in my view that, unless there is a one-on-one race in November, a Trojan Horse will take control of City Hall. I cannot spend more public money in the futile hope I am the one called to battle,” the beyond-long-shot independent tweeted.

A rep for the former federal prosecutor’s campaign did not immediately respond to an inquiry from The Post, but a source close to the situation blamed the suspension on “personal problems.

Jim Walden, NYC mayoral candidate, speaking at a town hall.Independent candidate Jim Walden suspended campaign for NYC mayoral election, his campaign announced on Tuesday. Kevin C Downs forThe New York Post

A recent poll showed Walden garnering just 3% of the vote in the still-crowded mayoral race.

He will still have to square up his campaign finances by paying back public matching funds, according to Campaign Finance spokesman Tim Hunter.

Walden raised $1.1 million and received more than $2.3 million in public funds.

“Once you received public funds and you drop out of the race, you have to return the matching funds,” Hunter said.

Walden only has about $1.24 million on hand.

Jim Walden announces withdrawal from NYC mayoral race.Walden posted his campaign suspension on X. 

Start your day with all you need to know

Morning Report delivers the latest news, videos, photos and more.

Thanks for signing up!

“There’s been a lot of internal bulls–t in this campaign to start,” the source said  after the announcement, noting turmoil in his personal life.

The married candidate will pay staffers through the end of the week, according to a campaign source.