The European Union's top competition regulator has conditionally given the green light for the massive rescue of Lufthansa by the German government, extricating one of the world's largest carriers from the pits of bankruptcy.

The overall bailout comes to 9 billion euros ($10 billion) with Lufthansa also getting three billion euros through public loan guarantees. The EU disclosed an infusion of 6 billion euros by Berlin to keep Lufthansa flying was approved, but that the airlines would have to allocate space for competitors at the Munich and Frankfurt airports to ensure equal competition.

According to EU competition commissioner Margrethe Vestager, the amount of aid will help the German carrier "weather the current coronavirus crisis, which has hit the airline sector particularly hard," TRT World reported.

Meanwhile, budget rival airline Ryanair quickly announced it would challenge Lufthansa's government bailout in an EU general court. In May, Ryanair Chief Executive Michael O'Leary complained that Lufthansa is "addicted to state aid," TRT World said. Lufthansa also owns Swiss, Austrian and Brussels Airlines, making the carrier a linchpin of European travel.

Lufthansa shareholders on Thursday overwhelmingly supported the 9-billion-euro rescue package by the German government, saving Europe's flagship airline group from total collapse after the global health crisis crippled demand for travel.

More than 98 percent of shareholders that comprise 39 percent of Lufthansa's stock voted in favor of the bailout program in a special meeting held online due to COVID-19. Lufthansa chairman Karl-Ludwig Kley said they will make the bailout work and expressed his gratitude for the trust of the shareholders.

The rescue package will see the German government take a 20 percent ownership of Lufthansa, bringing it back onboard for the first time since the airlines' privatization in 1997.

The largest stockholder of Lufthansa AG has publicly supported the government's rescue program, giving it a huge boost for the airline's shares and bonds just before a crunch vote.

With Heinz Hermann Thiele pledging support after days of frenzied speculation about his intentions, the state aid seemed to secure the two-thirds backing needed during the special shareholders meeting.

The German tycoon who had previously criticized the terms held the votes to bring the deal to a standstill and plunge the largest airline in Europe into turmoil.

Shares of Lufthansa soared more than 20 percent Thursday after its top shareholder did not object to the state aid for the German carrier pushed to the edge of bankruptcy because of the pandemic.

Thiele's support will come as a huge relief to German Chancellor Angela Merkel, who could not afford another major business collapse after the $2 billion fraud at Wirecard.