BRUSSELS (Reuters) - The European Union took a step on Friday towards suspending its cherished free-travel Schengen zone for two years by setting a deadline for Greece to stem the chaotic influx of migrants into the bloc.

EU ministers give Greece three months to fulfil 50 recommendations to put its house in order - a target that officials and diplomats acknowledged few expect Athens to meet.

If it fails, the members of the zone will be able to trigger a hitherto unused mechanism to impose longer-term checks on internal frontiers for up to four periods of six months on the grounds that security on a part of the zone’s external frontier has broken down.

“The point is not locking Greece out of Schengen. The point is, if the external border is not being controlled, it allows member states to keep the controls that are in place on their own internal borders,” said an EU official.

“If you don’t do this you are in a lawless zone and controls could last forever,” the official added.

Greece said it had done what it could to control the influx of refugees from Syria and other migrants: “The massive mixed migration flow is of a nature that would put the external border control of any member state under severe pressure,” it said.

Greece, the main gateway to Europe for more than a million refugees and migrants last year, has been overwhelmed by the influx and other EU states have increasingly criticised Athens for not managing the flows properly.

“The overall functioning of the Schengen area is at serious risk,” the European Council, which brings together EU countries’ governments, said after adopting the 50 recommendations for Greece, that include improving registration, sea border surveillance and border checks.

The EU ministers imposed the deadline on Friday by out-voting Athens’ rejection of a formal notice from the EU executive that it was “seriously neglecting its obligations” to control its part of the zone’s external frontier.

Four central-eastern EU states will discuss on Monday offering more help to Macedonia, which is the main route migrants and refugees take as they move north from Greece towards wealthier European states.