Former New York City Mayor Michael Bloomberg’s sudden regret for the controversial stop-and-frisk policing tactic he long defended might seem a little too convenient.

Speaking before a black megachurch congregation in Brooklyn on Sunday, Bloomberg finally asked for repentance after years of backlash: He apologized for his support of stop-and-frisk, which led to disproportionate police searches of black and Latino people.

“Over time I’ve come to understand something that I’ve long struggled to admit to myself,” Bloomberg said at the Christian Cultural Center in Brooklyn. “I got something important wrong. I got something important really wrong.”

It was the first time he’d publicly expressed any such remorse, though — even defending the policy as recently as January of this year. The difference now is that he’s considering jumping into the crowded pool of Democratic presidential candidates, although Bloomberg hasn’t formally announced a bid. To have any chance of standing out, he’ll need to earn the trust and support of black voters, a crucial voting bloc.

Bloomberg defended the stop-and-frisk policy throughout his 12-year tenure as mayor — and then long after he left office in 2013. Ostensibly, the policy was intended to deter violent crime by recovering dangerous weapons before they were used to hurt someone, but it decimated police-community relations by subjecting innocent black and Hispanic people to unnecessary searches sometimes described as humiliating and demeaning. And leading into Bloomberg’s apology Sunday, he defended his administration’s successes in reducing violent crime. (Data show that the policy recovered few guns, and there’s no evidence that stop-and-frisk led to a reduction in violent crime, as other cities saw their crime rates drop without the policy, too.)

“I was determined to improve police-community relations while at the same time reducing crime even further,” Bloomberg said of his previous thinking Sunday.

In 2013, a federal judge ruled the policing tactic violated constitutional rights and amounted to “indirect racial profiling,” as police were subjecting people of color to unnecessary stops over “suspicious behavior” that might otherwise be considered typical if a person were white. In some instances, people were stopped merely for being fidgety, looking over their shoulder, or crossing the street. According to the Center for Constitutional Rights, the policy lead to 575,000 stops in a single year at its peak in 2009. Blacks and Latinos were nine times as likely to be stopped, and the stops yielded only 762 guns.

Yet Bloomberg said at the time that the federal ruling was “dangerous” because stop-and-frisk had been successful in reducing violent crime, in his view.

“The fact is, far too many innocent people were being stopped while we tried to do that. The overwhelming majority of them were black and Latino,” he added. “That may have included, I’m sorry to say, some of you here today. Perhaps yourself or your children, or your grandchildren, or your neighbors, or your relatives.”