BERLIN (Reuters) - Air Berlin AB1.DE, Germany's second-largest airline, filed for bankruptcy protection on Tuesday after key shareholder Etihad Airways withdrew funding following years of losses, leaving valuable runway slots up for grabs.

The move offers Lufthansa LHAG.DE and rivals a chance to acquire slots at airports such as Berlin Tegel and Duesseldorf, with Germany's largest airline keen to defend its domestic position against expansion by low-cost rival Ryanair RYA.I.

Lufthansa confirmed it was in talks to take over parts of the business, while a source said easyJet EZJ.L was the second airline referred to by the government as being in talks with Air Berlin. The British budget carrier declined to comment.

The insolvency comes with thousands of Germans enjoying summer holidays, and just ahead of a September general election.

The German government has granted a bridging loan of 150 million euros ($176 million) to allow Air Berlin to keep its planes in the air for three months and secure the jobs of its 7,200 workers in Germany while negotiations continue.

The government said it expected decisions to result from these negotiations in the coming weeks.

Lufthansa has already leased Air Berlin planes to provide flights by its Eurowings budget airline and has made no secret of its interest in taking on more of Air Berlin’s business while being mindful of the potential obstacles posed by debts and anti-trust issues.

“Lufthansa has played a canny waiting game over a number of years and is now well placed to cherrypick those parts of Air Berlin’s operation that suit it best without buying the whole loss-making enterprise,” said Jonathan Wober, analyst at CAPA-Centre for Aviation.

RECORD LOSS

Ryanair said Air Berlin was being prepared for a Lufthansa takeover, which it said would breach competition laws. But German Transport Minister Alexander Dobrindt said he was confident there would be no anti-trust issues because the business would be sold off in bits.

In a statement published after trading hours, the Irish carrier said it had lodged a complaint with the German and European competition authorities regarding “the obvious conspiracy” playing out in Germany over Air Berlin.

“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’s statement said.

A spokesperson for the European Commission said it was in “constructive contact” with Germany about the Air Berlin issue.

Slideshow ( 5 images )

European Union state aid rules allow rescue and restructuring aid to companies that are in financial difficulty, but such aid is subject to strict conditions.

Air Berlin, which became famous for its “Mallorca shuttle” services, piled up debt after a series of takeovers and bookings have been hit in recent months by concerns over its finances.

It made a net loss in almost every year since 2008 and in 2016 reported a record deficit of 782 million euros ($915 million), equivalent to more than 2 million euros a day.

Slideshow ( 5 images )

Funding from Etihad Airways, which bought into Air Berlin in 2011, has helped keep it afloat and the Abu Dhabi-based airline provided an additional 250 million euros in April.

But Etihad has been reviewing its European investments after they failed to yield the profits expected. Alitalia [CAITLA.UL], another of Etihad’s investments, is also in administration and is seeking bidders.

Talks between Etihad and TUI TUIT.L, Europe's largest tour operator, about forming a joint venture holiday airline by merging TUIfly with Air Berlin's leisure airline Niki collapsed earlier this year.

Shares in Air Berlin last traded down 34 percent at 0.51 euros on Tuesday, valuing the airline at about 60 million euros. Ten years ago the carrier was worth around 1 billion euros.

Lufthansa shares were up 4.7 percent at 20.59 euros.

Pilots’ union Vereinigung Cockpit (VC) blamed the shortcomings of past management at Air Berlin for its woes and expressed anger with Etihad. “It is a scandal that Etihad is dodging its responsibility and is leaving Air Berlin’s staff out in the cold,” VC President Ilja Schulz said in a statement.