Williams presented an Amnesty International petition with 65,000 signatures demanding the government get asylum-seekers off the islands.
"We've come to Canberra to call on the Australian government to finally accept the New Zealand offer to resettle 150 refugees a year," Foster said.
"There are still just under 300 people stranded on PNG and Nauru and as the deal with the US is about to come to an end it is more urgent than ever we get these refugees to safety as soon as possible."
Williams compared the refugees' situation to how people have struggled to cope with Covid-19 quarantine conditions imposed around the globe.
"We were up in arms to do quarantine for two weeks, imagine doing it for seven years plus – but with no end in sight.
"There's a solution – New Zealand want to take them ... we just need the people in power to say yes and let 'em go," he said in a video on Twitter with Foster.
"New Zealand has a proud resettlement history. Since the Second World War it has resettled over 35,000 refugees. This is not about politics, this is about a few hundred refugees who have suffered for too long and who are in need of a solution. New Zealand has offered to provide that solution, Australia should accept," Williams said.