With nearly $14 billion in federal COVID-relief aid on the line, New York, New Jersey, and Connecticut were having trouble coming to an agreement on how to divvy up the huge pot of relief money. The MTA had insisted the money should be divided based on the operating budgets of each transit agency. The governors of New Jersey and Connecticut insisted on using the federal formula—which is used for infrastructure projects and is used by the 47 other states—that would have given the MTA slightly less money by about $637 million.

Neither side was budging as the Tuesday deadline drew near.

But on Tuesday morning, all three states put out a statement saying an agreement was reached. The MTA secured $10.85 billion, while New Jersey walked away with $2.66 billion and Connecticut $474 million.

“As a result of a series of productive conversations with my fellow governors, I'm glad that we have reached an agreement that is beneficial to all,” New York Governor Kathy Hochul wrote in a statement.

In addition to the funds in the grant program, New York has agreed to give New Jersey an additional $75 million from its share. And New Jersey it get $363 million from Philadelphia. The state has also applied for an additional $400 million in supplemental grants, for a total of $3.5 billion for the region to be used to cover operating losses

“Nothing is more critical to our region's economic recovery than our mass transportation system. With this agreement, we ensure a reliable and safe commute as workers return to their offices," NJ Governor Murphy wrote in a statement.

The money comes from the Coronavirus Response and Relief Supplemental Appropriations Act, 2021, and the American Rescue Plan Act.

In August, Murphy had become so exasperated dealing with the MTA he wrote a letter to Transportation Secretary Pete Buttigieg and asked him to intervene.

Earlier this year, the MTA had to borrow $2 billion to cover operating expenses until these funds were released. By state law, the MTA must end the year with a balanced budget. These funds may be used to pay off that loan and ensure the MTA, which is predicting deficits in the coming years, can avoid the worst fare hikes or service cuts.

While ridership is up at the MTA this fall, it’s still only about 50% of what it was before the pandemic. The agency relies heavily on ticket sales to cover the bulk of its budget, which is why federal relief has been so crucial to keep trains running throughout the pandemic.

This story has been updated to reflect additional funding for New Jersey.