BERLIN (Reuters) - Lufthansa <LHAG.DE> and its main cabin crew union have agreed a new 3.5 year pay deal for 19,000 staff plus a change in pensions, ending an industrial dispute that caused the longest strike in the carrier's history.

Although Lufthansa still has a long-running row with pilots on its hands, the agreement with cabin crew announced on Tuesday will allow it to reduce staff costs and move ahead with its plans for budget unit Eurowings.

Lufthansa has been trying to cut costs but its plan to revamp pensions and expand low-cost operations ran into resistance from its two main staff groups, leading to repeated strikes and souring relations between management and unions.

The new cabin crew deal, negotiated by a mediator, includes a pay rise of almost 5.5 percent from Jan 2016 to June 2019, plus a one-off payment of 3,000 euros ($3,344), which has already been paid. Lufthansa ruled out compulsory redundancies for five years.

Among the 20 different contracts agreed via a mediation process was the agreement of a defined contribution pension scheme rather than a defined benefit scheme, in line with what many other major European companies have done.

Overall, the agreement, which also includes flexible contracts to better cover seasonal demand, will allow Lufthansa to bring staff costs for cabin crew down by about 10 percent compared to previous projections, Bettina Volkens, Lufthansa board member for HR, told journalists.

The changes to the pension scheme should save Lufthansa around 70 million euros a year, a person familiar with the talks said.

The deal includes a scheme to avoid conflict in the future, such as the right for the company to call a mediator should a major strike be threatened. A contract for budget unit Eurowings was also agreed, including permanent contracts with the option to switch to the main Lufthansa brand and a pension scheme.

"It's a good deal for the staff, and for the company," said Nicoley Baublies, who led the talks for the union.

Attention now turns to negotiations with pilots' union Vereinigung Cockpit, for which Lufthansa also wants to agree a defined contribution pension deal. Lufthansa CEO Carsten Spohr said on Monday he was optimistic for those talks and when it came to costs, Lufthansa was doing what it could.

(Reporting by Victoria Bryan; Additional reporting by Peter Maushagen and Klaus Lauer; Editing by Arno Schuetze and Georgina Prodhan)