Switzerland says it will risk the legal collapse of its trade, security and free travel agreements with the EU, if Brussels cannot stop uncontrolled migration into the country. The government is preparing a law that will impose quotas for incomers, starting from 2017.

"If there is really no solution, we would be ready for a suspension of a part or all of the bilateral agreements," said Foreign Minister Didier Burkhalter, referring to the EU’s struggle to control the inflow of unregistered migrants, which will exceed 1 million by the end of 2015.

The new legislation will be prepared by March 2016, on the basis of a referendum dating back to February 2014, in which the Swiss narrowly upheld a right-wing proposal to restrict immigration within three years.

Switzerland rejects Croatia free movement deal after immigration referendum http://t.co/tckrm3IGpK — RT (@RT_com) February 16, 2014

“A specific threshold will be set for the immigration of citizens of EU and European Free Trade Agreement states, which, if exceeded, would lead to quantitative limits and quotas being introduced the following year,” said a statement from the government, released on Friday.

“This would safeguard the bilateral path and re-establish the legal certainty that is so important to Switzerland's economy.”

About a quarter of the country’s 8.2 million population are non-citizens, with 300,000 people traveling into Switzerland daily to take advantage of some of Europe’s highest wages. Government-endorsed economists say stopping migrants will make the average Swiss citizen up to 3.9 percent worse off in terms of GDP over the next two decades, than if the current laws stay in place.

The migrant influx has largely been the result of a series of agreements signed in 1999, which include free travel, a removal of trade restrictions, closer co-operation in air and road traffic, and joint security work.

Residential mortgage debt-to-GDP ratio of 120% in #Switzerland is highest in the OECD see https://t.co/cZPFbTejfMpic.twitter.com/MNgWySU5va — OECD Economics (@OECDeconomy) December 1, 2015

In recent years, the travel part of the agreement has engendered resentment among the Swiss, who have seen property prices climb even higher, and public facilities stretched. But the bundle of treaties with the EU were signed under a “guillotine clause” – if either party abandons one of them, the rest are automatically renounced.

"It wouldn't be clear what measures the European Union would take," admitted Swiss President Simonetta Sommaruga, after questions about whether the unilateral border controls would lead to a backlash. "We want to continue discussions with the goal of reaching an agreement on a protection clause. That's the best way.”

Meanwhile, EU interior ministers are meeting throughout Friday in Brussels to modify the Schengen free travel agreement, which has been breaking up as countries have erected border fences and instituted controls in response to the flood of migrants.