The powers of the domestic spy agency will be substantially ramped up after legislation cleared parliament.

Parliament has given Australia’s spies more powers to fight terrorism.

The federal government’s first tranche of tougher counter-terrorism legislation, which passed the lower house on Wednesday, substantially ramp-up the powers of ASIO.

Justice Minister Michael Keenan said the bill was the first step in the government’s response to existing and emerging security threats.

“The government’s number one priority is to keep Australia safe … from those who would seek to do us harm,” he told parliament.

The legislation cleared the Senate last week with bipartisan support.