Major League Baseball and the players' association reached agreement on a new collective bargaining agreement Wednesday night, concluding nearly nine months of negotiations just hours before the old agreement expired.

A baseball official with direct knowledge of the negotiations confirmed that MLB and the union wrapped up the five-year deal. They spoke on condition of anonymity because the accord has not yet been announced.

MLB and the MLBPA have been negotiating since March on a new CBA to replace the five-year agreement that was set to expire after midnight Wednesday. However, it was thought to be a soft deadline, and both sides were prepared to continue negotiating to avoid a lockout.

Sides continued making progress Wednesday night on key issues, most notably the luxury tax threshold, which has been set at $189 million but is expected to rise. USA TODAY Sports reported Tuesday that MLB preferred keeping the threshold at $189 million for another season before increases in subsequent years.

With baseball approaching nearly $10 billion in annual revenues, motivation was strong on both ends to maintain labor peace, a streak that will now stretch from 1996 into 2021.