THE HAGUE, Netherlands >> A pair of bills cracking down on asylum-seekers wishing to settle in the Netherlands has passed in the Dutch parliament after wrangling and soul-searching by some lawmakers who feared the law would criminalize offering compassionate help to undocumented migrants.

The legislation cuts temporary asylum residency from five to three years, indefinitely suspends the issuance of new asylum residency permits and reins in family reunions for people who have been granted asylum.

It passed in the lower house late Thursday evening but could still be rejected in the upper house.

Organizations that work with migrants have condemned the legislation. VluchtelingenWerk, an organization which helps refugees living in the Netherlands said in a statement that the bills were “harmful to society as a whole” and called on the upper house to reject the bill.

The Association of Dutch Municipalities, which represents city governments, said the bills were “legally untenable” and would cause chaos. “Municipalities will soon have to break one law in order to comply with another law,” the group’s chairperson Sharon Dijksma said in a statement.

The acting immigration minister David van Weel told reporters Friday that the bills don’t “win any beauty prizes.”

Taking tough measures to rein in migration was a policy cornerstone for the four-party coalition led by Geert Wilders’ far-right Party for Freedom. The coalition collapsed last month after just 11 months in office, and migration is expected to be a key issue ahead of the snap election Oct. 29.

Wilders pulled the plug on the coalition saying it was taking too long to enact moves to rein in migration. His coalition partners rejected the criticism, saying they all backed the crackdown. His party currently holds a narrow lead in opinion polls over a center-left two-party bloc that recently agreed to a formal merger.

The opposition Christian Democrats withdrew its support for the legislation put to the vote Thursday over a late amendment that would criminalize people living in the Netherlands without a valid visa or asylum ruling — and would also criminalize people and organizations that help such undocumented migrants.