Police and spy agencies will soon be able to press technology firms to help them access suspected terrorists’ and criminals’ encrypted messages on platforms such as WhatsApp and Telegram after the Morrison government struck a last-minute deal with Labor.

Attorney-General Christian Porter announced what he called "a massive win for the Australian people" on Tuesday afternoon with just two days left of the parliamentary year.

"Serious criminal offences - homicides, terrorism, child sex offences - are being facilitated by serious criminal networks communicating on encrypted applications," he said.

"We've been told by our law enforcement heads and by ASIO that this legislation was necessary not to give them an edge but to give them, in their words, a fighting chance."

Shadow attorney-general Mark Dreyfus said the government had agreed to Labor’s demands to make changes to the legislation including greater oversight and limiting authorities’ access to encrypted communications to the most serious crimes.