PARIS (AP) — France's Parliament has adopted a sweeping counterterrorism law that replaces a 2-year-old state of emergency and is meant to give police more tools to fight violent extremism.

The Senate voted Tuesday 244-22 to approve the bill, President Emmanuel Macron's first major security measure.

The legislation enjoyed broad support, although lawmakers made amendments to respond to criticism that the original version would infringe on individual liberties.

The law gives law enforcement greater authority to conduct searches, to close religious facilities and to restrict the movements of people suspected of extremist ties.

The final approval came in time for the law to take effect by Nov. 1, when the state of emergency is set to expire.

It first was imposed in November 2015 after the Paris terror attacks that killed 130 people.