By Mark Mardell
BBC Europe Editor, Brussels
Turkey faces years of tough EU membership negotiations
"The train is still on the tracks," declared UK Foreign Secretary Margaret Beckett at the end of a meeting of European Union foreign ministers in Brussels.
For months, commentators have been warning of a "train crash" if talks about Turkey joining the EU were completely derailed.
But the ministers have agreed to punish Turkey for so far refusing to open its ports and airports to EU member Cyprus without going as far as some countries had wanted.
They have agreed to freeze talks on eight important areas out of 35.
Several countries, including Cyprus, Greece, Germany, France and the Netherlands had been arguing for stronger punishment.
There was also a proposal to give Turkey a specific deadline to open its ports, but the idea of an ultimatum was also rejected.
De facto embargo
Turkey is refusing to open its ports because it wants a de facto embargo lifted on the self-declared Turkish republic of northern Cyprus, which no other country in the world recognises.
The EU has agreed to look again in January at easing the restrictions.
While EU officials claim there is no direct link, it would be politically nearly impossible for Turkey to change its position without getting something in return.
Already Turkey's powerful armed forces have warned that they were not consulted about a very tentative and verbal government offer to open up two ports.
The commissioner in charge of enlargement, Olli Rehn, said that the agreement was finely balanced.
"It sends a signal to Turkey that failure to meet legal obligations cannot remain without consequences but it enables progress in talks," he said.
Mr Rehn called Turkey "an anchor of stability in the most unstable region of the world and a benchmark of democracy in the Middle East and the Muslim world," adding that it showed Islam was compatible with European values.
This agreement comes against a background of prominent politicians in many EU countries questioning whether the predominantly Muslim country should ever be a member because of its different culture - which in their view is not European.
Ms Beckett says "the train is still on the tracks" for Turkey
But the UK's Margaret Beckett told the BBC that there are people who say that, but what is significant is that the member governments of the EU do not share that view.
Diplomats predicted the issue would dominate the two-day summit of EU presidents and prime ministers at the end of the week, but the Finns - who are coming to the end of their six-month presidency - were desperate for the meeting not to be dominated by the row.
While an immediate crisis has been avoided it also means the leaders of the EU have ducked a chance to hammer out what does, and should, define the organisation.
The underlying questions about Turkish membership have not gone away.