The Virginia General Assembly agreed Saturday to give Metro $154 million a year in permanent, new funding, on the condition that Maryland and the District make somewhat larger contributions to provide the transit system with a total of up to $500 million more annually.

The action in Richmond marked what appeared to be a historic step in securing for Metro a significant source of dedicated revenue that it has lacked since the subway opened in 1976.

Virginia has long been viewed as a major obstacle to approving such funding, partly because the legislature is controlled by Republicans who have been skeptical of investing in public transit.

The new money would be used to revive a transit system beset by aging equipment and long-needed repairs.

It remained necessary to resolve differences between the Virginia legislation — passed by the Senate and the House of Delegates, and welcomed by Gov. Ralph Northam (D) — and a similar bill before the Maryland General Assembly. A key issue is the varying amounts each jurisdiction will pay, based on population and ridership.

But the breakthrough in Richmond follows a similar advance in Annapolis this month. Gov. Larry Hogan (R) endorsed a Metro funding bill passed by the Democratic-dominated House, which would give Metro $150 million a year in dedicated funding if Virginia and the District each pledged the same amount or more.

The District, the strongest supporter of Metro funding, plans to go along with whatever the two states decide rather than risk blocking a regional agreement, officials said.

Virginia’s action drew applause from much of the region, including from Hogan, D.C. Mayor Muriel E. Bowser (D) and Metro. It also was hailed by business groups, environmentalists, unions and grass-roots civic organizations that have been pressing for increased Metro funding.

Metro General Manager Paul J. Wiedefeld, whose performance was praised by Virginia lawmakers of both parties, said, “On behalf of all Metro customers and employees, as well as the communities whose economic well-being depends on a safe, reliable Metro system, we are truly grateful.”

But some Northern Virginia legislators and local officials complained that Metro’s victory had come at too steep a cost for area road projects, which will lose money being diverted to the transit system. They expressed hope that Northam would reduce the impact.

On the final day of the legislature’s regular session, both chambers passed a Metro bill giving the agency $132 million a year. The additional $22 million would come from an increase in regional wholesale gasoline taxes contained in a separate bill, passed Friday, which set a minimum level for such levies in Northern Virginia and Hampton Roads.

The package met House Republican demands by dropping two proposed tax increases in Northern Virginia — on real estate transactions and hotel stays — that had been included in the original Senate version of the bill.

Instead, the legislature found the necessary money by redirecting funds from other priorities, especially road and other transportation improvements in Northern Virginia.

The final bill says Metro would get the money only if it meets requirements to improve governance and financial management. Virginia would withhold 35 percent of the new money if Metro asks for more than a 3 percent annual increase in the state’s subsidy of the transit system’s operating budget. The bill also would streamline Metro’s board of directors by reducing the role of nonvoting members.

“The reforms were included to ensure that the problems that Metro has experienced over the last decade do not reoccur,” Del. Timothy D. Hugo (R-Fairfax), one of the bill’s sponsors, said.

The Virginia legislation is designed for Metro to get an additional $500 million a year in permanent funding, the amount the transit system says it needs to ensure safety and reliability.

But there was some uncertainty about whether the full $500 million would be secured, because the bill’s language was not specific about how much Maryland and the District would contribute.

The legislation says Virginia would supply $154 million on the condition that Maryland and the District each contribute amounts that are “proportional . . . to their respective share” of total Metro funding.

The bill’s authors said that means Maryland would give $167 million a year and the District $179 million — because that is what an existing Metro cost-sharing formula would dictate, if Virginia contributed $154 million. The formula is based on factors including population, ridership and number of Metro stations.

“We’re doing our part, and we’re challenging and inviting our partners in Maryland and D.C. to meet their obligations in the proper proportion,” said Del. Richard C. “Rip” Sullivan Jr. (D-Fairfax), one of the six negotiators in the joint conference that produced the final bill.

Maryland and District officials declined to commit at this time to go as high in funding as Virginia wants. As a result, some officials said, the total of new money for Metro would be at least $450 million but might not reach $500 million.

Metro would use the money to buy new rail cars and buses, replace other worn-out equipment and catch up on overdue repairs.

Wiedefeld sought the extra $500 million a year last April, when he said Metro needed $15.5 billion for capital investments over the next 10 years — an average increase of nearly 30 percent over the agency’s previous request.

The Virginia bill’s passage comes after nearly two years of intense study and debate in the Washington region over how to address Metro’s long-standing problems, which have occasionally had fatal results. Nine people died in a 2009 Red Line crash, and one passenger was killed and scores injured in a 2015 smoke incident outside L’Enfant Plaza station.

A regionwide agreement on dedicated funding for Metro would represent a rare example of high-level cooperation among the region’s three jurisdictions. Other examples include the operation of the Metropolitan Washington Airports Authority, which oversees Reagan National and Washington Dulles international airports, and of the Blue Plains sewage treatment facility.

The bill approved Saturday emerged after five days of closed-door bargaining between representatives of the House and state Senate. An impasse was broken when Democrats and some Republicans agreed to raise the money without imposing the Northern Virginia tax increases.

But the diversion of money from transportation funds allocated to Northern Virginia was not welcomed in counties such as Prince William and Loudoun, which are eager for road upgrades to deal with severe traffic congestion.

“I was concerned the General Assembly would rob Peter to pay Paul for Metro,” Loudoun Supervisor Matthew F. Letourneau (R-Dulles) said. “By raiding even more funding already earmarked for transportation projects in Northern Virginia, this bill doesn’t just rob Peter, it pillages him.”

Northam’s office declined to comment on hopes that he would seek to amend the bill.

Virginia’s Republican leaders came around to support revenue for Metro partly because of pressure from the state’s business community. Chambers of commerce and other groups said Metro is critical to the prosperity of Northern Virginia, the economic engine for the state.

That point was driven home by the prospect that Northern Virginia might win the nationwide contest to be the site of Amazon’s second headquarters, adding 50,000 new jobs. The online retail giant says one of its main criteria is access to public transit. Amazon chief executive Jeffrey P. Bezos also owns The Washington Post.

“Metro is a core statewide asset that is vital to Virginia’s economic future — this investment is a recognition of that fact,” said Michael Forehand, senior vice president of government and public affairs of the Northern Virginia Chamber of Commerce.

The governance and management conditions set by the bill mostly followed the original Senate version, which was less restrictive than the House version.

The final bill would bar the eight nonvoting directors on the Metro board from participating in full Metro board meetings, unless they were sitting in place of an absent voting member.

That would cut in half the number of directors participating in full meetings, and presumably make discussions more efficient, as many reformers have advocated.

The 3 percent ceiling on annual increases in Metro operating subsidies has been endorsed previously by Wiedefeld. The House version had proposed a tighter limit of 2 percent.

The conference bill softened an anti-union provision in the House measure, which would have required a “right-to-work” provision for Metro projects solely in Virginia. Instead, conferees agreed that for such projects in Virginia, a project labor agreement obliging the hiring of union labor could neither be required nor prohibited.