NEW YORK - Police Commissioner James O'Neill apologized Thursday for the police raid of the Stonewall Inn 50 years ago.

"The actions and the laws were discriminatory and oppressive," said O'Neill. "And for that I apologize."

Until O'Neill spoke those words, no top NYPD official had apologized for the police raid on the Stonewall Inn in June 1969.

The raid was part of a pattern of harassment against gays and lesbians and the bars they frequented.

But Stonewall was a breaking point, triggering days of unrest now considered the beginning of the modern gay rights movement.

"I do know that what happened should not have happened," said O'Neill. "The actions taken by the NYPD were wrong, plain and simple."

The surprise apology came at the start of a security briefing about how police will handle this month's World Pride celebration and the 50th anniversary of the Stonewall uprising.  

It also came a day after City Council Speaker Corey Johnson, who is openly gay, called for the commissioner to issue an apology, but Johnson said he had no idea O'Neill would do so.

"The NYPD never should have been treating LGBT people like that," said Johnson. "And it is time to have reconciliation and healing, and that's what today is about."

Organizers of this year's pride march were also looking for an apology, approving a resolution Wednesday night calling on the NYPD to finally acknowledge it was wrong for raiding Stonewall.

"The reality is this apology needed to happen this year," NYC Pride Spokesman James Fallarino said. "You can't celebrate the 50th anniversary of this uprising without the NYPD acknowledging its role in all of this."

But not all LGBT rights groups were pleased with the apology. The organizers behind the Queer Liberation March called it "phony" and "empty."

"The NYPD has spent decades entrapping gay men," the group said in statement. "And the NYPD continues to strike fear in communities of color and other marginalized communities."

But some members of the LGBT community who attended the security briefing said they viewed the apology as sincere and a good step toward healing the wounds from years of harassment by the police.