* Shareholder Etihad withdraws financial support
* Lufthansa says in talks for take over of parts of group
* Government provides bridging loan, flights continue (Adds details from Lufthansa, comments by government, analyst)
BERLIN, Aug 15 (Reuters) - Air Berlin, Germany's second largest airline, filed for bankruptcy protection on Tuesday following years of losses and after key shareholder Etihad Airways withdrew funding, with bigger rival Lufthansa saying it is in talks to take over parts of the business.
The insolvency comes as thousands of Germans are enjoying their summer holidays and just ahead of a September general election.
But Berlin said it has granted a bridging loan of 150 million euros ($176 million) which will allow Air Berlin to keep its planes in the air for three months and secures jobs for its 7,200 workers in Germany while negotiations continue.
Air Berlin is in talks with Lufthansa and another airline about selling its assets, the government said, adding that it expected a decision in the coming weeks.
Lufthansa has already leased crewed planes from Air Berlin 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, although it has said debts and anti-trust issues were potential obstacles.
"Lufthansa has played a canny waiting game over a number of years and is now well-placed to cherry pick those parts of Air Berlin's operation that suit it best without buying the whole loss-making enterprise," Jonathan Wober, analyst at CAPA-Centre for Aviation, said.
Air Berlin, which became famous for its "Mallorca shuttle" services, piled up debt after a series of takeovers and concerns over its finances have hit bookings in recent months.
It has made a net loss in almost every year since 2008 and in 2016 reported a record loss of 782 million euros ($915 million), equivalent to a loss of more than 2 million euros a day.
Funding from Etihad Airways, which bought into the airline in 2011, has helped to keep it afloat in recent years, but the Abu Dhabi-based airline has been reviewing its European investments after they failed to bring in the profit it expected.
Italian national airline Alitalia, another of Etihad's investments, is also in administration and seeking bidders for its business.
Meanwhile talks between Etihad and TUI, 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.
Etihad last provided additional funding of 250 million euros to Air Berlin in April.
"However, Air Berlin's business has deteriorated at an unprecedented pace, preventing it from overcoming its significant challenges and from implementing alternative strategic solutions," Etihad said in a statement on Tuesday.
Shares in Air Berlin were down 39 percent at 0.47 euros by 1248 GMT, valuing the airline at around 45 million euros. Ten years ago the carrier was worth around 1 billion euros.
Lufthansa's shares were up 2.5 percent at 20.15 euros.
Pilots' union Vereinigung Cockpit (VC) blamed the shortcomings of past management at Air Berlin for the airline's financial 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. ($1 = 0.8548 euros) (Reporting by Victoria Bryan, Maria Sheahan; and Gernot Heller; Editing by Greg Mahlich)