The Greens have lashed Labor for supporting the Coalition government’s move to force migrants to wait up to four years to access some welfare benefits.

Migrants granted a permanent skilled or family visa after 1 January next year will have to wait four years for payments like Newstart or concessions cards.

The government had initially wanted all welfare payments to have a four-year wait time, but agreed to shorter periods for a raft of payments after negotiating with Labor.

The Greens senator Nick McKim angrily attacked the ALP, saying they had done a deal under the cover of darkness to inflict poverty, misery and homelessness on thousands of migrants

“It is a Trump-esque punishment of migrants in this country that Labor has stitched up with the Liberal party so they can get a few budget savings in before they take government next year,” McKim said.

Labor claims it took the “rough edges” off a bill to save it from being left to One Nation to negotiate.

But with independents Tim Storer and Derryn Hinch and Centre Alliance’s two senators opposed, Labor could have teamed up with the Greens to block the legislation.

The Labor frontbencher Doug Cameron said the opposition had worked constructively to improve the bill, arguing the Greens didn’t have to be responsible because they will never form government.

“Common sense and the Greens don’t go together – should never be in the same sentence,” Cameron said.

The Greens senator Mehreen Faruqi said she knew “the human cost” of measures like this as she and her husband struggled to get jobs as engineers when they first moved to Australia in 1992.

“It was the middle of the recession we had to have, jobs were few and far between and, of course, we had the added burden of not having local experience, even though we had degrees that were recognised [the] world over,” she said.

“While no one would give us a job, the support system in Australia at that time did recognise that migrants do need financial assistance to survive, and we were provided this assistance.”

“It’s pretty rich of Labor to stand here and tell us we don’t understand the complexities. Well you know what, mate, I’ve lived the complexity.”

The One Nation leader, Pauline Hanson, said she was proud of Labor’s support for the measures.

She believes migrants who choose to come to Australia should make sure they can provide for themselves because they have given nothing to the country.

“We are seeing the fools of the world come on down to treasure island – that’s what Australia’s all about,” Hanson said.

Under the amendments, the wait for carer payments, parental leave pay, as well as dad and partner pay will be extended to two years.

The changes will result in a one-year wait for a carer allowance and family tax benefit part A.

Wait times will not apply to single-parent migrant families or those with one income earner.

The Australian Council for Social Services urged Labor not to support the bill.

“Migrants make huge contributions to our society,” it said in a statement.

“We should be supporting them when they need it, not making it harder for them to build a life in Australia.”

Meanwhile, the government introduced a separate bill in the lower house to allow the immigration minister to specify visa categories that have to provide fingerprints and photo ID in applications.