BERLIN (Reuters) - Air Berlin's (>> Air Berlin Plc) last flight landed in its home city on Friday night, greeted by a traditional water cannon salute and bringing to an end almost four decades of flying.

Air Berlin, beloved among Germans for its flights to holiday island Mallorca and the chocolate hearts it gives out after each flight, filed for administration in August. A government loan kept its planes in the air during negotiations on its carve-up.

Flight AB6210, with the special call sign BER4EVR, departed Munich at 2035 GMT and landed in Berlin Tegel at 2145 after carrying out a farewell tour over the city.

The plane's arrival at the airport was watched by 1,600 staff and aviation fans from a packed viewing platform in Berlin, while several hundred staff gathered on the apron to welcome the crew and passengers.

"I am happy to be here, but with tears in my eyes," Sabine, an administrative worker at the airline, who arrived with friends, clutching a large heart, said.

The company has agreed to sell a large part of its airline assets to domestic rival Lufthansa (>> Deutsche Lufthansa), and just after the final flight said it had clinched a deal with Britain's easyJet (>> EasyJet) for some operations at Berlin Tegel.

Others are eyeing the gap left by Air Berlin. IAG (>> International Consolidated Airlines Group), which owns British Airways, said it saw opportunities for its Vueling budget brand in Germany.

Air Berlin was founded nearly 40 years ago by U.S. pilot Kim Lundgren, taking advantage of the fact that at that time only carriers based in Britain, France or the United States were permitted to fly to Berlin. The first flight took off from Berlin's Tegel airport for Palma de Mallorca on April 28, 1979.

After German reunification, entrepreneur Joachim Hunold bought a majority stake in the carrier and in the mid 2000s grew Air Berlin via acquisitions.

But the airline never fully integrated those purchases and the expansion left it laden with debt. The rise of low-cost carriers in Europe, and Lufthansa's strength in Germany, added to pressure and meant it struggled to turn a profit.

Since listing on the stock market in 2006, it has racked up losses of around 3 billion euros (2.65 billion pounds), equivalent to an average of around 25 million euros a month.

Financial support from major shareholder Etihad kept it afloat over the last few years, but the Abu Dhabi-based carrier pulled the plug in August, leaving the fate of around 8,000 staff and thousands of customers in the balance.

Captain David McCaleb, who piloted the final flight after 27 years with Air Berlin, said he wanted to keep flying but that, at the age of 60, job offers could be hard to find.

"It's bittersweet. It's strange to experience an ending like this," he told Reuters ahead of the final flight.

With around 30 million passengers a year, Air Berlin was much larger than Britain's Monarch, which collapsed at the start of this month and had carried 5.7 million in 2015.

(This version of the story refiles to fix typo in cannon in first paragraph).

(Reporting by Klaus Lauer and Victoria Bryan; Editing by Pritha Sarkar and Sandra Maler)

By Victoria Bryan and Klaus Lauer