Former mayor Michael Bloomberg offered a stunning apology on Sunday for his administration’s reliance on stop-and-frisk policing, admitting to a Brooklyn church, “I was wrong, and I am sorry.”

The bombshell reversal ends Bloomberg’s zealous, years-long defense of one of the most contentious parts of his three-term legacy — and comes as the billionaire political moderate positions himself for an expected 2020 Democratic presidential run.

“I was totally focused on saving lives. But as we know, good intentions aren’t good enough,” Bloomberg told congregants at East New York’s Christian Cultural Center, one of the city’s largest black churches.

“As crime continued to come down as we reduced stops — and as it continued to come down during the next administration, to its credit — I now see that we could and should have acted sooner, and acted faster, to cut the stops,” Bloomberg admitted, offering a rare compliment to his successor, Mayor de Blasio.

“I can’t change history,” he said. “Today, I want you to know that I realize back then I was wrong, and I am sorry.”

The mea culpa missed the mark for many, even uniting oft-opponents as the Police Benevolent Association blasted the apology as “too little, too late” for Bloomberg’s “misguided policy,” and de Blasio accused his predecessor of timing that was “transparent and cynical.”

But at the church — whose pastor, the Rev. A.R. Bernard, is a longtime Bloomberg ally — the former mayor’s about-face received resounding applause.

“I know that politicians often just say whatever they want people to hear,” said one church-goer, who declined to give her name but said she had been arrested protesting Bloomberg’s policies.

“But I pray that he was being honest and I think that if his heart has really changed for the better, he could do a lot of good.”

Said Keith Gaunlett, 41, of Crown Heights, “I think his efforts to do things differently and admit his mistakes are applaudable. … The fact that [he] said it in public, that’s not easy to do.”

Bloomberg’s apology for the keystone of the NYPD’s policing policy throughout his time in office would have been unthinkable as recently as this year.

The practice was the subject of a long-running federal civil rights lawsuit — Floyd v. City of New York — that alleged the policy discriminated against black and brown New Yorkers, despite the NYPD’s protestations otherwise.

The case concluded with a blistering August 2013 ruling from Manhattan federal Judge Shira Scheindlin, who determined that stop-and-frisk was “unconstitutional” and tantamount to “indirect racial profiling.”

Bloomberg — then in the final months of his mayoralty — fired back.

“What does she know about policing? Absolutely zero,” he fumed in a radio appearance. “It’s easy for somebody in a court to say, ‘Oh [the cop] should have done this or should have done this.’”

Bloomberg continued his full-throated defense of stop-and-frisk after leaving office, brushing aside lawsuits that cost the city millions — and that crime continued to fall even as the de Blasio administration limited stops.

There were nearly 686,000 stops at the height of the practice in 2011, which fell to just 11,000 in 2018, stats tracked by the New York Civil Liberties Union show.

The city clocked 515 homicides in 2011, which fell to 295 in 2018.

The city paid $75 million in 2017 to settle a 2010 lawsuit that alleged NYPD cops issued thousands of bogus summons to meet quotas, which the police department denied it never had.

Plaintiffs tied the bunk tickets to the NYPD policies that were “selectively and disproportionately enforced” in minority communities, echoing arguments made against stop and frisk.

As recently as January, Bloomberg backed the policy in a question-and-answer session at the US Naval Academy’s 2019 Leadership Conference, according to CNN.

“We focused on keeping kids from going through the correctional system. … Kids who walked around looking like they might have a gun, remove the gun from their pockets and stop it,” he said at the time, noting that the tactic more than halved the city’s murder rate on his watch.

On Sunday, Bloomberg insisted that he had pure intentions, but admitted for the first time that he — and the NYPD under his watch — went about it the wrong way.

“Our focus was on saving lives,” he told the congregation.

“The fact is, far too many innocent people were being stopped while we tried to do that,” he added. “That may have included — I’m sorry to say — some of you here today.”

Bloomberg’s dramatic course-correction comes amid a shift in the national debate over criminal justice policy, fueled by concerns over costs and implications of aggressive policing and incarceration.

The effects have been most visible in the Democratic Party, where Bloomberg appears to be poised to join its crowded field seeking the nomination to challenge President Trump in 2020.

As he first took the temperature of this election cycle’s candidate pool in a December 2018 event in Iowa, protestors confronted him over his support of the policy.

It’s the latest reckoning that Bloomberg has faced of late as his 2020 plans continue to crystalize.

On Thursday, the billionaire apologized for misogynistic remarks he made during his time in the private sector.

And then again on Sunday, he offered his latest expression of regret.

“Because the number of stops of innocent people had been so high, resentment had build up, and we eroded what we had worked so had to build,” he told congregants. “Trust.”