BRUSSELS — European Union leaders appointed Italy's Mario Draghi as the next president of the European Central Bank on Friday — a move that gives investors much-needed certainty over who will lead the institution in its pivotal role in the fight against the crippling debt crisis.

The timing of Draghi's appointment had come under doubt as fellow Italian executive board member Lorenzo Bini Smaghi had until Friday refused to leave his post.

With Bini Smaghi staying on the executive board, France would not have a representative on the six-person board once current ECB chief Jean-Claude Trichet departs on Oct. 31. The French had previously implied they would only support Draghi if a Frenchman or woman takes Bini Smaghi's spot.

However, a European official said Friday that Bini Smaghi had now agreed to step down by the end of the year. The official was speaking on condition of anonymity because the moved had not officially been announced yet.

The European Parliament and the ECB board had already given their approve to Draghi's appointment.

Delaying his appointment until their next summit in September would have underlined divisions among EU leaders, who have already struggled to find a common line on debt-stricken Greece and the best way of containing the financial crisis that has also pushed Ireland and Portugal into needing massive bailouts.

The ECB has played a central role during the debt crisis that has afflicted the 17-country eurozone over the past 18 months or so. For example, Trichet overrode criticism from some of the more hawkish officials at the bank when he backed a multibillion euro (dollar) bond-buying program intended to ease the pressure on the more indebted countries.

More recently, the ECB has found itself in the difficult position of raising interest rates to keep a lid on above-target inflation levels even though the weaker eurozone economies remain weak.

The decision on Draghi was expected a day after EU leaders gave their clearest sign yet that Greece will get a second bailout in the coming weeks, on top of last year's €110 billion ($156 billion).

"We agreed that there will be a new program for Greece," said German Chancellor Angela Merkel.

The stronger language on aid for Greece was also made possible after debt inspectors from the EU and the International Monetary Fund reached a final deal Thursday with the government in Athens on €28 billion worth of new austerity measures.

The measures have to be passed by the Greek Parliament next week for the bailout funds to be released. If lawmakers fail to back the package, then Greece will likely be staring at a default on its debts.

Even if it gets a second bailout, many economists think that Greece will have to restructure its debts in some shape or form in the coming years, especially if the economy shrinks further.