NEW YORK (AP) — The City Council has voted to pass bills that will create an outside watchdog for the nation’s biggest police department and make it easier for people to file profiling claims against it, overriding mayoral vetoes.

The lawmakers voted Thursday on the new oversight at the New York Police Department.

Proponents see the legislation as a check on a police force that’s come under scrutiny for its heavy use of a tactic known as stop and frisk and its extensive surveillance of Muslims, which was revealed in stories by The Associated Press.

Mayor Michael Bloomberg had vetoed the legislation as unnecessary. He says it will jeopardize the city’s safety. The lawmakers overruled him.

A federal judge recently ruled the NYPD discriminated against minorities with its stop and frisk program and ordered a monitor to oversee changes.

The measures mark the most aggressive legislative effort in years to put new checks on the NYPD. And the vote comes less than two weeks after U.S. District Court Judge Shira Scheindlin’s order for a monitor to focus on stop and frisk, a practice she said the department had used in a way that violated the rights of hundreds of thousands of black and Hispanic men. The city is appealing.

The lawsuit-related component of the legislation passed in June with just the 34 votes needed to override a veto. At a rally before the meeting, activists chanted “34″ and held signs that said, “Override.”

“What happens in New York city has consequences for the nation,” National Association for the Advancement of Colored People head Benjamin Jealous said, suggesting that police elsewhere look to the NYPD as an example.

Two of the council members whose attendance was in question made it to City Hall in time. Councilman Fernando Cabrera returned from Lima, Peru, for the vote.

City Council Speaker Christine Quinn said Thursday there were enough votes expected, though she opposed the lawsuit component. She supported the inspector general.

Civil rights groups and minority advocates had pushed for the legislation. It’s been propelled by complaints about stop and frisk and the department’s extensive surveillance of Muslims.

The laws will bring “oversight, transparency, accountability and, yes, efficiency, to the NYPD,” said Fahd Ahmed, the legal director of Desis Rising Up and Moving, a South Asian advocacy group with mostly poor, Muslim members.

Supporters say the new laws, coupled with the judge’s ruling, would end practices they see as unfair and would mold a more trusted, effective police force.

Bloomberg and police Commissioner Raymond Kelly say that between the council measures and the court ruling, a police force that has fought crime down to record lows will be tangled up in second-guessing and lawsuits.

“We think both pieces of legislation are unwise and will undermine public safety,” Kelly said Wednesday.