Australia will allow gun owners to hand in illegal firearms without penalty from next month as concerns grow over gun crimes involving such weapons, a federal minister said on Friday.

The three-month nationwide amnesty on surrendered firearms will be Australia’s first since 1996, when a lone gunman killed 35 people in Tasmania state and galvanized support for tough national gun controls.

Justice Minister Michael Keenan said the new amnesty was needed to reduce the number of guns in the community because of new security threats including Islamic extremism.

There have been five violent incidents in Australia that the government describes as terrorist attacks since the national terror threat level was raised in September 2014. Three involved illegal guns and two involved knives.

“We’re living in a time when our national security environment has deteriorated,” Mr. Keenan said.

Mr. Keenan said handing in unwanted guns in the community would reduce the chances of these guns falling into the hands of violent criminals.

“My expectation is it’s probably not going to be the case that we would have hardened criminals, for example, who have made a big effort to get hold of illegal guns necessarily handing them in,” Mr. Keenan said.

“But the purpose of this amnesty is to actually reduce the number of unregistered and illicit firearms in the community,” he added.

The 1996 amnesty also included a gun buyback program. The Port Arthur massacre led state governments to legislate tough restrictions on rapid-fire weapons and to buy back almost 700,000 newly outlawed guns.

The Australian Bureau of Statistics shows the nation has since imported almost 1.2 million legal guns. Military-style, semi-automatic assault rifles continue to be banned from public ownership.

There are 2.89 million registered guns among 24 million Australians, an increase of 9.3 per cent in the past five years, the report said. An Australian Criminal Intelligence Commission report released last year estimated there could be as many as 600,000 unregistered guns in Australia.

Most illegal guns in Australia were legally owned before 1996, when guns did not have to be registered. They were not handed in during the buyback and there are no records that they even exist, the report said.

The report said the market for illegal guns is partly driven by Middle Eastern crime gangs, outlaw motorcycle clubs and other groups that traffic illegal commodities such as drugs.

It said guns can be bought easily in the United States and sent to “countries such as Australia with relative anonymity, especially where transactions are made using emerging technologies and business practices, such as the darknet and freight-forwarding services.”

Sydney University gun policy analyst Philip Alpers said overseas experience suggested that the new amnesty would collect only “rubbish guns” that were not valued by either legitimate gun owners or criminals.

The government plans to crack down on illegal guns by introducing a mandatory five-year minimum prison term for gun traffickers, and by boosting screening of international mail, air and sea cargo.