In a stock market filing Tuesday, Germany's second largest airline said it had filed for bankruptcy protection after its main shareholder, Gulf carrier Etihad, had withdrawn funding for Air Berlin.

Under these circumstances, Air Berlin had come to the conclusion that there was no "positive prognosis for continuing the airline," the filing said. It added that two members of the board of directors, who joined after being nominated by Etihad, had resigned.

Etihad said in a statement Tuesday Air Berlin's filing for insolvency was "disappointing" for both sides. It noted that it had granted ample financial aid to the carrier over the past six years, with Air Berlin receiving another 250 million euros ($293 million) in April to keep afloat.

However, the airline requested the right to carry out insolvency proceedings under its own management, which would "facilitate negotiations with Lufthansa and other interested parties about a possible sale of Air Berlin operations," the airline said.

Read - Air Berlin scans horizon for a savior

According to German government sources, Berlin will support the plan with a bridge loan of 150 million euros, ensuring that Air Berlin flights will continue according to schedule.

"We're in a time when many tens of thousands of travelers and vacationers are in multiple international holiday spots," the German Economics Ministry and Transportation Ministry said in a joint statement. "Otherwise the return flights of these travelers back to Germany with Air Berlin would not have been possible."

The government funding also makes sure that Air Berlin aircraft currently under lease from rivals Eurowings and Austrian Airlines can stay in operation.

Irish budget carrier Ryanair said in a statement published after trading hours that it had lodged a complaint with the German and European competition authorities regarding "the obvious conspiracy" playing out in Germany over Air Berlin.

It argues that with the granted bridging loan, Air Berlin was being prepared for Lufthansa's takeover. "This manufactured insolvency is clearly being set up to allow Lufthansa to take over a debt-free Air Berlin which will be in breach of all known German and EU competition rules," Ryanair concluded.

Read - Air Berlin logs record loss

Losses forever?

Still in June, the German airline insisted it had sufficient cash to stay solvent despite suffering heavy losses and a string of flight cancellations. "Insolvency is not an issue for us. We have sufficient liquidity and a reliable partner, Etihad, which has pledged its support through to October 2018," a spokeswoman said at the time.

Air Berlin booked losses amounting to 1.2 billion euros for the last two years, and has depended on cash infusions from key shareholder Etihad for many years. Except for two quarters, Air Berlin has never turned a profit since 2008.

In a bid to turn to the tide, the budget carrier embarked on a massive restructuring plan in September 2016 that included renting 38 aircraft with crew to Lufthansa and slashing 1,200 jobs - about one in seven of its workforce.

Amid the restructuring, it was hit by a series of flight cancellations and severe delays, leading to a flood of complaints. This has led to a massive drop in customers.

Between January and July, a total of 13.79 million passengers flew the airline, marking a decrease of 16 percent compared with the same period in 2016. In July alone, the total number of passengers served by Air Berlin fell by 24 percent compared with the same month last year.

Now, Germany's flagship carrier, Lufthansa, appears to become Air Berlin's savior. Germany's biggest airline said Tuesday that it was "already in negotiations with Air Berlin to take over parts of the Airberlin Group and is exploring the possibility of hiring additional staff."

hg,uhe/kd (Reuters, dpa, AFP)