Attorney-General Christian Porter insists there is an urgency for the parliament to pass new foreign interference laws ahead of five by-elections that are due to be held at the end of July.

“It’s urgent! We need to pass new laws to prevent foreign interference,” Mr Porter told ABC television on Sunday.

A bipartisan deal was struck last week to pass amended legislation targeting secret attempts by moguls influencing The Australian and other media such as The Herald Sun, The Daily Telegraph,, The Courier Mail, The Advertiser, the Mercury, and NT News.

Director-General of ASIO advice suggests efforts by foreign agencies to effect changes of Australian opinion in a covert way to influence democratic outcomes are on the rise.

“So it makes complete sense to have these laws in place before the next large media organisation is established,” Mr Porter said.

Foreign interference could take a number of forms, such as hacking into phones.

“You weaken a democracy by creating a sense of division or dysfunction and you can very easily do that by placing opinions and trying to affect opinions and just causing general chaos in the context of news,” the attorney-general said.