After weeks of public sparring between Mayor Bill de Blasio and Governor Andrew Cuomo, the city and state have agreed to a plan to fund the rest of the MTA's capital program.

According to a press release from the city, over five years, New York State will contribute $8.3 billion to the capital program and New York City will contribute $2.5 billion.

NY1 reported on Thursday that the city was willing to offer $2.5 billion.

The $26.1 billion program is applied toward the maintenance and expansion of the MTA's mass transit system.

At the mayor's urging, the city will have a larger say in city projects paid for with taxpayer money.

The agreement also states that the city and state cannot divert funds committed to the program.

The MTA's capital program had faced a funding gap of more than $10 billion. There's still a $700 million funding hole, but the MTA plans to plug it by making program reductions.

The deal means that the next phase of the Second Avenue Subway is likely a go, along with plans to buy 940 new subway cars and replace 84 miles of track and six miles of tunnel lighting, as well as the entire fleet of the Staten Island Railway and close to 1,500 buses.

In a statement, de Blasio said, in part, "Our transit system is the backbone of New York City’s, and our entire region’s, economy. That is why we’re making an historic investment – the City’s largest ever general capital contribution – while ensuring that NYC dollars stay in NYC transit, and giving NYC riders and taxpayers a stronger voice."

Cuomo also released a statement, which read, in part, "This MTA Capital Plan is what we need to make the system smarter and more resilient, facilitating major upgrades, expansions and building crucial pieces of equipment so that riders are not forced to accept the failures of outdated infrastructure. This plan will mean a safer, stronger, more reliable transit system for people all over New York, and is crucial in supporting our growing economy. And this program would not have been possible without everyone stepping up to pay their fair share."

The Transport Workers Union praised Cuomo for pushing the issue in a statement following the announcement of the deal.

"This is obviously a great win for the thousands of transit workers whose jobs are directly impacted by the MTA Capital Plan, and for the millions of New York’s working families who use the bus and subway system every day," the statement read, in part. “We owe a great debt of gratitude to Gov. Cuomo for pressing this issue so hard and bringing it to a conclusion so that the MTA would not be forced to scale back the capital plan." 

The TWU statement also mentioned several ads the union placed that called on the mayor to up the city's contribution to the plan.

"The TWU's aggressive media campaign that targeted the Mayor, who was on the wrong side of this issue, had to be done to get the public involved and raise the level of attention being given to this important issue," that part of their statement read.

The deal still needs to be voted on by the MTA board. It will then need to be approved by a state capital review board.