French President Emmanuel Macron delivers a speech on security to representatives of French national police, gendarmes and "Sentinelle" security plan soldiers at the Elysee Palace in Paris, France, Wednesday, Oct. 18, 2017. Macron is expected to launch a new police unit that would focus on daily life especially in working-class neighborhoods. (Philippe Wojazer/Pool Photo via AP)

French President Emmanuel Macron delivers a speech on security to representatives of French national police, gendarmes and "Sentinelle" security plan soldiers at the Elysee Palace in Paris, France, Wednesday, Oct. 18, 2017. Macron is expected to launch a new police unit that would focus on daily life especially in working-class neighborhoods. (Philippe Wojazer/Pool Photo via AP)

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.