Metro and its largest union have tentatively agreed to a four-year labor contract that would allow the transit agency to give up its strategy of privatizing some operations to save money, the two sides said Tuesday.

The unexpected deal, which resulted from months of secret negotiations between Metro General Manager Paul J. Wiedefeld and Raymond Jackson, president of Amalgamated Transit Union Local 689, appeared designed to win labor peace by removing the biggest point of contention between the agency and its workforce.

The union has strongly objected to Metro’s privatization of operations at the Cinder Bed Road bus garage in Northern Virginia, where a strike by ATU Local 689 is underway, and its plans to privatize the second phase of the Silver Line rail extension.

The new accord appeared likely to lead to an end to the garage strike, which has shut down or reduced service on Metrobus routes used by about 8,500 riders daily.

The deal also represented a significant reversal by Wiedefeld on privatization. He has said Metro needed to outsource some operations to private companies or risk breaking a 3 percent cap in the growth of annual subsidies it receives from the District, Maryland and Virginia.

A joint statement by Metro and ATU Local 689, which represents about 8,000 Metro employees, called the deal “a major development” and said it “would create incentives for better customer service, enable Metro to live within its legally-required 3 percent subsidy growth cap, and create a path to bring in-house work performed at Cinder Bed Road bus garage and on the Silver Line.”

The four-year collective-bargaining agreement would take effect when the current contract expires June 30. It requires approval by both the Metro board and ATU membership.

The joint statement said the agreement “has benefits for both labor and management,” but details about wages and benefits were withheld for now. That is to allow Jackson time to inform his union members and Wiedefeld to brief the Metro board.

“After many months of negotiation, we reached a good deal for our employees that also provides our board of directors with an affordable option for bus and rail service for the next four years,” Wiedefeld said.

“I am pleased to have a deal that I can recommend to my members,” Jackson said. “This deal will help safeguard our jobs against privatization. This deal would benefit all of our members and solidify transit careers as a pathway to the middle class. We look forward to providing details to our members as soon as possible.”

Conversations between Metro and the union over the agreement began in the spring, with serious negotiations starting in July between Wiedefeld and Jackson.

In April 2017, Wiedefeld proposed outsourcing some Metro operations to private companies where it would be cost effective. He did so as part of a broad plan to hold down costs and encourage the District, Maryland and Virginia to provide Metro with dedicated funding, which they agreed to do last year.

But ATU Local 689 has pushed back hard, fearing both job losses and reduced wages and benefits. Tension heightened between the union and Metro when nearly 130 workers at the Cinder Bed Road Metrobus garage in Lorton went on strike Oct. 24 against Transdev, the France-based multinational transit company Metro has contracted with to run the facility. It is the first strike involving Metro employees in more than four decades.

Workers at the garage are protesting a lack of raises, medical benefits that include deductibles of several thousand dollars, work conditions and retirement benefits they say are less favorable than those of workers employed directly by Metro for doing the same jobs.

The garage is the base for 18 Metrobus routes that crisscross mainly Northern Virginia, and the strike, now nearing its 50th day, has canceled or limited service on all of them.

The garage is the only portion of Metro’s main transit services that has been privatized. Metro chose to outsource bus operations there after it built the facility two years ago, awarding Transdev an $89 million contract for three years, plus two one-year options.

With fare revenue in decline, annual operating costs rising, and a statutory limit on how much state and local funding Metro can request, the transit authority viewed contracting out operations as a way to save $15 million over five years by not paying the new garage employees Metro pensions and retirement benefits.

Wiedefeld has long indicated his plans to privatize phase two of the Silver Line, a six-station extension that brings Metro to ­Dulles International Airport and into eastern Loudoun County.

In addition to their quest for better wages and benefits, union officials viewed the Cinder Bed Road garage fight as a battle “for the future of public transportation” and the last chance to stop further privatization of the system.

Last week, workers with the Fairfax Connector, which is operated by Transdev through a contract with the county, also went on strike, in a move that the union said was partly meant to put greater pressure on Metro. The Connector is Virginia’s largest public bus service, serving an estimated 30,000 riders weekdays.

Connector workers agreed to return to work Monday while negotiations continue, but several Fairfax elected officials blamed Metro’s privatization efforts for causing the region’s bus strikes. County supervisors also indicated that they did not want to see the Silver Line privatized, putting more pressure on Metro. Half of the six new stations are in Fairfax. All of the phase one stations are in the county.

“This union has moved its members over the last two months to show everyone in this region that privatization is a failed model,” ATU Local 689 political organizer Brian Wivell said. “Ultimately this fight came down to if transit jobs were going to be a decent path to the middle class or disposable replaceable $20-an-hour jobs that Transdev was trying to turn them into.”

Wivell declined to provide specific details of the agreement, but he said the plan will be voted on by union members in coming days.

“The union is very happy with what it’s seen so far and looks forward for its members to look at this deal for themselves and hopefully vote in favor of it,” he said.