MANHATTAN - A deal was reached yesterday to stop the Long Island Rail Road strike. 

The deal between the MTA and the eight unions representing LIRR employees was agreed upon at Gov. Andrew Cuomo's office in Manhattan. The two sides had been locked in a bitter dispute, with talks breaking down at points recently. The strike was supposed to begin at 12:01 a.m. Sunday.

Talks continued through the night Wednesday into Thursday morning, when Cuomo called both sides to his office. The deal was reached just after 1 p.m. Thursday. 

The deal will give employees 17 percent raises over 6 1/2 years. For the first time, all employees will also contribute to their health insurance costs. New employees will have to work longer to get top pay and contribute more to their pension plans.

The unions had been without a contract since 2010.