Players union chief Tony Clark and MLB commissioner Rob Manfred are negotiating a labor accord for the first time in their new roles. (AP/AP)

Major League Baseball and its union reached a deal Wednesday night on a new collective bargaining agreement, averting a potential work stoppage with just hours to spare and ensuring a sport once known for its labor strife will extend its current run of peace beyond a quarter-century.

In a statement late Wednesday, MLB characterized the five-year agreement as tentative and “subject to ratification by both parties.” Assuming it happens, it would mean baseball, nearly devastated by the players’ strike of 1994-95, will have gone 26 years without a work stoppage by the time the new deal expires.

Negotiators for the owners and the players’ association faced a 12:01 a.m. Thursday deadline before the expiration of the old CBA and reached agreement with just more than three hours to spare. The owners had threatened a lockout — which would have halted the offseason free agent and trade markets and jeopardized next week’s annual MLB winter meetings at National Harbor — if the sides could not agree on at least the framework of a deal.

The final sticking point appeared to have been the competitive-balance tax, which since 2003 has penalized teams for going over a specified payroll limit. The players succeeded in getting the owners to raise the threshold — from $189 million in 2016 to $195 million in 2017 and rising steadily to $197 million, $206 million, $208 million and $210 million in the last four years of the agreement. As the players argued, the so-called “luxury tax” increase is commensurate with rising revenue, which in 2015 was just under $10 billion.

Among the other final issues to be resolved were the international draft, in which the owners wanted but ultimately failed to tamp down bonuses paid to foreign players, and draft-pick compensation, which has shifted a prime draft pick from the team that signs a top free agent to the team that lost him. Despite the players’ concern that this serves as an unfair disincentive for teams to sign free agents, some sort of compensation system will remain — and go into effect beginning next offseason — but one that is expected to be less penal for the signing team.

The new agreement, then, is not significantly different from the old one. Even on the issue of roster sizes — for which the sides batted around various tweaks — there will be no changes, with active rosters remaining at 25 per team and rising to 40 in September.

Since the end of the 1994-95 strike — which was resolved thanks in part to the efforts of judge Sonia Sotomayor, now a Supreme Court justice — baseball has enjoyed its longest period of labor peace since the formation of the union in 1966. In that time, the NHL, NFL and NBA have seen a combined seven work stoppages. Baseball’s past two labor agreements, in 2006 and 2011, were reached well in advance of the deadlines, with minimal acrimony.

It wasn’t surprising that this agreement took longer to hammer out, in part because it marked the first CBA since Rob Manfred — formerly Bud Selig’s labor lieutenant — took over as commissioner and since Tony Clark succeeded the late Michael Weiner as union chief. Manfred and Weiner enjoyed a strong professional relationship as opposing negotiators, but some owners grumbled privately that the union under Clark was slow to respond to their proposals.

After months of fitful negotiations, it required a marathon bargaining session that lasted from Tuesday into the wee hours of Wednesday and another long session Wednesday afternoon and evening to reach this deal. Though some of the final issues were significant — and the international draft, in particular, an emotionally charged one — most industry observers felt the possibility of a work stoppage was remote all along, if only because both sides recognized the economic health of the sport and understood a stoppage was the surest way to squander it.