Image copyright Getty Images Image caption Eurozone bond-buying is legal according to a top EU lawyer

A top European Union lawyer has said that the European Central Bank's planned bond-buying programme is legal.

Advocate General Cruz Villalon said the ECB's Outright Monetary Transactions (OMT) programme is compatible, in principle, with EU law.

But he said that if the programme is implemented, its compatibility will depend on certain conditions being met.

The bond-buying is aimed at avoiding a break-up of the euro, but has faced a legal challenge from Germany.

Announced in 2012, the OMT plan has never been put into practice, although it has helped restore confidence in eurozone markets.

However, with the eurozone facing the threat of deflation and recession, there is increasing pressure on the ECB to start a separate programme of quantitative easing (QE), which would involve starting a bond-buying operation similar to OMT.

Jonathan Loynes, chief European economist at Capital Economics, said: "Overall, then, the final hurdle to quantitative easing appears to have been cleared.

"But given the ECB's natural caution, Germany's objections and the limited effects of QE in other countries, it would be hopeful to expect it to transform the eurozone's economic outlook."

Analysis: Andrew Walker, BBC World Service economics correspondent

The sighs of relief from the ECB and eurozone finance ministries are almost audible.

It's worth emphasising just how successful the OMT programme has been in taking the heat out of the eurozone financial crisis. Of course, the wider economic challenges are still profound. OMT will not fix them. But it did bring real calm to the financial market dimension of the crisis, despite the fact that the ECB has not spent a single euro under the programme.

It's a striking example of how a policymaker's statement that it's willing in principle to do something can sometimes shift expectations so much that the announcement alone gets the intended result. As for quantitative easing - which we expect the ECB to embark on soon - this legal opinion may not have a direct bearing, but QE is also about bond-buying, so it could have presented some serious legal complications.

The Advocate General has avoided them.

Challenge

Germany's Federal Court challenged the OMT's legality in the European Constitutional Court of Justice, arguing the ECB was acting beyond its mandate, effectively financing government deficits.

In his opinion, published on Wednesday, Advocate General Villalon argued that the ECB must have a broad discretion when framing and implementing the EU's monetary policy.

He said it would first have to spell out its justification for any bond-buying programme and not be involved in any direct aid programme to any eurozone member state involved.

He also warned that the courts lacked the expertise and experience of the central bank in this area and should be careful about criticising the ECB.

Wolfgang Kuhn, Aberdeen Asset Management's head of pan-European credit, said: "The opinion criticises the German court for daring to refer the case the way it did and seems to say that it can't be up to national courts to judge what goes on at a European level.

"The opinion removes another inconvenient obstacle to [ECB president Mario] Draghi's big quantitative easing gamble, which will now almost certainly be announced next week. But the voices that see both OMT and QE as a blatant breach of EU treaty law will only grow more shrill."

The Advocate General's opinion is an influential legal proposal to the Court of Justice, but is not binding.

OMT and QE

There are some important differences between OMT and QE.

Firstly, the objectives are different. Under OMT, the aim is to tackle excessively high borrowing costs for governments that result from fears that the country concerned might give up the euro.

The aim of QE would be to combat deflation or falling prices.

There is also a difference in which bonds would be bought.

With OMT, it would be the ones where government borrowing costs are considered too high.

The QE plan is still being developed, but it could involve buying the bonds of all eurozone governments.

In both cases, the ECB would buy bonds with newly created money.

With OMT, the bank would take steps to eliminate the impact on the total amount of money in the banking system by a process known as sterilisation.

However, with QE, this would not happen.