The MTA and transit workers union reached a tentative contract agreement Monday after failing to meet a midnight deadline, union president John Samuelsen said.

“We won a tentative contract with solid raises and other strong economic gains, moving transit workers well ahead of inflation and greatly improving their quality of life,” Samuelsen said. “That was our goal. We achieved it.”

Contracts between the MTA and TWU Local 100, which represents about 38,000 MTA employees, had expired at 12 a.m. Monday.

The agreement comes after nearly two months of negotiations, which were kicked off with a massive union rally outside MTA headquarters in November. Main topics under negotiation included wage increases and safety reforms for the workers who operate, maintain and repair the agency’s NYC Transit bus and subway network.

Both parties had been negotiating all day Sunday, but did not come to an agreement by the midnight deadline.

“At midnight we were still negotiating the economic package and the length of agreement,” Samuelsen said in an earlier statement.

Contract negotiations are believed to be one of the last major handlings of outgoing MTA Chairman Tom Prendergast, who has maintained an unusually affable relationship with the union. That’s in part because Prendergast’s deep history at the agency and knowledge of workers’ concerns.

advertisement | advertise on newsday

More details about the new contract were not immediately available.