BERLIN (Reuters) - Lufthansa (>> Deutsche Lufthansa AG) and its main cabin crew union have reached a deal in a long-running dispute over pay, conditions and pensions, they said on Thursday, a boost for the carrier which is also negotiating with pilots.

The deal was achieved thanks to a mediator, who will formally announce the terms on Tuesday once a few final details have been agreed, the two sides said.

Until then, both sides said they had agreed to keep the terms confidential.

Lufthansa is trying to cut costs to better compete with low-cost rivals within Europe, such as Ryanair (>> Ryanair Holdings plc) and easyJet (>> easyJet plc), and also with leaner rivals such as Emirates and Turkish Airlines (>> Turk Hava Yollari AO), on long-haul routes.

Lufthansa management and the cabin crew union UFO have been at loggerheads since September 2013, when Lufthansa said it wanted to cancel a decades-old early retirement scheme. The row culminated in November, when UFO staged the longest-ever strike in the German carrier's history.

A dispute with its pilots stretches back four years but the union and Lufthansa said last month they hope to reach a deal by the end of July.

More than 20 issues were being discussed in the mediation process with cabin crew, ranging from pay, details of a pension scheme, working conditions at low-cost carrier Eurowings and terms for moving staff to other airlines in Germany within the Lufthansa group.

Shares in Lufthansa were up 1.3 percent at 1244 GMT.

(Reporting by Victoria Bryan and Klaus Lauer; Editing by Elaine Hardcastle)