TORONTO -- A Second World War law used by police to make mass arrests during the G20 summit in Toronto in 2010 was officially scrapped Thursday and replaced with new legislation.

The Public Works Protection Act was secretly revived by the Liberal government prior to the G20, and then used by police to "kettle" or detain large groups in the streets, and to arrest 1,100 people during the summit of world leaders.

Ombudsman Andre Marin concluded it was opportunistic and inappropriate to use a "war measure" to give police extra authority, and said police compounded matters by misrepresenting the reach of their new powers during the G20.

"Apart from insiders in the government of Ontario, only members of the Toronto Police Service knew that the rules of the game had changed, and they were the ones holding the 'go directly to jail cards," Marin wrote in a special report.

"The Ministry of Community Safety quietly promoted the use of a likely illegal regulation to grant police extravagant powers on the eve of the G20 summit."

The law designed to protect electrical generating facilities from Nazi saboteurs in the 1940s was replaced by a new bill, given final reading Thursday, that enhances security at courthouses, electrical generating stations and nuclear power plants.

The Progressive Conservatives said they supported the new bill because the old Public Works Protection Act clearly had to be replaced.

"We were somewhat outraged that people were kettled and treated unfairly," said interim PC Leader Jim Wilson. "I think any reasonable person looking back at that time would say the reasonable thing to do is side with the government and change the law.

The government said the new law will protect critical infrastructure in a way that respects civil liberties, but it will be up to local police to decide if they will demand identification from people wanting to enter a public courthouse.

"It formalizes the process that exists, which involves the local police working with the judiciary, with the lawyers, and with those who work in court buildings, in determining what the right safety protocols should be," said Community Safety Minister Yasir Naqvi.

"The operational decision on what security measures to be put in place is a decision to be made at the local level."

The New Democrats were pleased the new law would take into account articles of faith such as the ceremonial kirpan, a small, ceremonial knife carried by male Sikhs, but said they were concerned it would infringe on civil liberties by allowing police to search cars of people driving to courts.

"There are issues around people having their vehicles checked without any reason," said NDP Leader Andrea Horwath. "There doesn't have to be a probable cause or any reason for these searches to take place, and that is a reduction of current civil liberties."

The government worked with civil liberties groups, law associations and community safety experts on the new law after having former chief justice Roy McMurtry review the 75-year-old Public Works Protection Act, added Naqvi.

"There was a lot of consultation," he said. "The bill passed today was designed based on the recommendations that the former chief justice had provided to us."