The European Central Bank (ECB) headquarters

Germany's constitutional court Tuesday quashed a eurosceptic lawsuit against one of the European Central Bank's key crisis-fighting tools, as the ECB steeled itself for market turmoil from a possible Brexit.

Throwing out a long-running suit by a group of politicians and academics, Germany's highest court ruled that the ECB's 2012 bond-buying plan called Outright Monetary Transactions (OMT) were legal under the country's constitution.

While the OMT scheme has never actually been used, it was part of ECB President Mario Draghi's landmark promise to do "whatever it takes" to save the battered euro at the height of the crisis in 2012.

That vow, backed by the announcement of the OMT programme, helped reduce borrowing costs for the most debt-hit countries, calmed markets and brought the eurozone back from the brink.

The promise of OMT was that the ECB could, if necessary, buy up unlimited amounts of government bonds from debt-stricken countries that had pledged reforms such as Italy, Spain and Portugal.

Critics charged that the ECB is essentially printing money and lavishing it on states, leaving taxpayers with the risk of one day having to foot the bill.

The ECB has since launched a range of other policy measures aimed at kick-starting the eurozone's moribund economy and driving inflation back up to levels more compatible with healthy growth.

- Within ECB's mandate -

Few observers had expected the Constitutional Court to torpedo the ECB's programme.

In January 2014, it had voiced concerns about OMT but then kicked the case up to the European Court of Justice (ECJ) in Luxembourg.

The EU's highest court has since essentially backed OMT, arguing that while the ECB's chief purpose is price stability, it may also support EU economic policy goals.

Reading out the Constitutional Court's ruling on Tuesday, judge Andreas Vosskuehle found that the OMT did not overstep the ECB's mandate.

ECB chief Draghi, speaking at a hearing of the EU's Committee on Economic and Monetary Affairs in Brussels, said the central bank "took note" of the findings.

The EU Commission was more forthcoming, saying it "welcomed" the ruling.

The head of the DIW think tank, Marcel Fratzscher, hailed it as "intelligent" and "wise".

But others were not so pleased. The head of the influential Ifo think tank, Clemens Fuest, accused the judges of "doing a U-turn" and kowtowing to the ECJ.

Berenberg Bank economist Holger Schmieding said the ruling "makes it even more likely that the German court will also reject" pending lawsuits against the ECB's other policy measures, including against the ECB decision to broaden bond purchases from only sovereign to corporate bonds.

That move is part of the ECB's massive quantitative easing, or QE, stimulus programme that aims to boost inflation and growth in the 19-member currency bloc.

The ECB has also slashed interest rates to zero, further raising hackles in Germany because low rates hurt savers, and pumped more than one trillion euros ($1.1 trillion) into the financial system.

- Cheap cash, Brexit fears -

The Constitutional Court ruling came in a very busy week for the ECB, which is scheduled to launch the next round of ultra-cheap loans for banks, who are meant to pass the credit on to the real economy, meaning households and business.

The scheme is known as targeted longer-term refinancing operations, or TLTRO.

And on Thursday, all eyes will be on Britain's referendum on whether to stay in the EU or leave.

Both the euro and pound have dipped in the lead-up to the vote, as analysts fear a Brexit would spark market panic.

On the bond market, German 10-year bonds saw their yields drop below zero last week, a sign of a run on safe investments.

Financier George Soros warned of a Black Friday plunge in sterling if Britain votes to quit the EU as new polls showed a razor-tight race 48 hours ahead of the referendum.

Speaking in Brussels, ECB chief Draghi said that it was very difficult to predict the possible economic and financial repurcussions of the outcome of the vote, but that the bank was prepared for all eventualities.

"We're trying to be ready to cope with all possible contingencies," the ECB chief continued.

"We've done all preparation that is necessary now."