European Union finance ministers said on Tuesday Hungary had not done enough to bring its budget gap below the EU's agreed ceiling in a sustainable way, opening the way to a freezing of payments of EU funds to Hungary from 2013.

The ministers' decision, endorsing a European Commission assessment, is the next step in a long process that has never seen meaningful action against member states, most of whom have broken the 3 percent of gross domestic product ceiling.

But it comes at a time when Hungary is under increasing pressure from across Europe to overturn two years of legislation by the ruling Fidesz party that some critics have termed an attack on democracy.

Like Belgium, Cyprus, Malta and Poland, Hungary had until this year to bring its budget deficit sustainably below 3 percent under the EU's excessive deficit procedure.

While the Hungarian deficit is set to come in below the limit this year, the Commission has said it will only be so thanks to one-off measures and that the shortfall will grow again in 2013.

The Council (of finance ministers) today adopted a decision establishing that Hungary has failed to comply with the Council's recommendation on measures to be taken in order to bring its government budget deficit below the EU's reference value of 3 percent of GDP, the ministers said in a statement.

Hungary cannot face sanctions under the excessive deficit procedure as it is not a member of the euro area. But for beneficiaries of the EU's cohesion fund, such as Hungary, failure to comply with the Council's recommendations can lead to the suspension of cohesion fund commitments, they said.

It is now up to the European Commission to impose financial sanctions on Budapest from 2013 unless Hungary takes steps this year to change its budget policy. Cohesion funds are allocated by the Commission for funding projects such as roads and railways as well as education and training.

Hungary should in the near future take action to meet its targets, EU Economic and Monetary Affairs Commissioner Olli Rehn told a news conference after the ministers' meeting.

There is ample time to take action and ensure that the fiscal targets are met, Rehn said.

Although long present in the EU toolbox of sanctions for non-euro zone countries breaking EU budget rules, the EU executive arm has never used such a sanction before.

AID

Hungarian Finance Minister Gyorgy Matolcsy said Budapest would avoid sanctions.

I am quite optimistic that Hungary will avoid the freezing of cohesion funds, Matolcsy told reporters after the meeting.

Hungarian Prime Minister Viktor Orban is to meet Commission President Jose Manuel Barroso later on Tuesday to discuss reopening talks on a precautionary credit line from the EU and the International Monetary Fund as Hungary's economic prospects deteriorate.

The Commission has threatened legal action against Budapest unless Hungary changes laws on the central bank, courts and data protection, which the Commission says have been altered to suit Orban's ruling party and are not in line with EU law.

I am 100 percent sure that the outcome of the meeting will be positive, because Hungary will comply with the European Commission's (views) covering all the outstanding issues -- the central bank issue, the excessive deficit procedure issue and other political issues, Matolcsy said.

We don't expect a breakthrough very soon, but in a few weeks' time..., Matolcsy said.

Orban's efforts to centralise power and stack Hungarian state bodies with party loyalists have drawn criticism from Brussels and Washington, which fear they stifle democratic freedoms in the ex-communist country of 10 million.

Orban has lost a large part of his support at home, while the economy is heading for recession and investors' loss of confidence has pushed borrowing costs to more than 9 percent.

Matolcsy would not say how much money Hungary needed in the precautionary credit line, but said that in 2008, the country had 20 billion euros on stand-by.

Asked when Budapest expected to have the money, Matolcsy said: In the coming weeks we can start all the detailed negotiations and in a couple of months we will have the final outcome.

(Reporting By Jan Strupczewski; Editing by Rex Merrifield and Patrick Graham)