Major League Baseball agreed to pay $185 million as part of a settlement with minor league ballplayers who say the league exploits them, knowing they will play for peanuts for a chance to make it to the big show.

The settlement also strikes down an MLB rule that prohibited teams from paying minor leaguers for work beyond the regular season. That prohibition had kept teams from paying players for attending spring training and instruction leagues.

“This is an historic outcome for current and future minor league baseball players; it eliminates the main barrier towards ensuring that they are paid for the work that they do,” lawyers for the players said Friday in a court motion seeking approval of the settlement.

The settlement must be approved by a judge.

“We are only in the second year of a major overhaul of the 100-year-old player development system and have made great strides to improve the quality of life for minor league players,” an MLB spokesman said in an emailed statement. “We are pleased we were able to come to a mutually agreeable resolution but are unable to comment on the details until the agreement is formally approved by the court.”

But the settlement won’t turn minor leaguers into millionaires, like many of their major league counterparts. In terms of pay, all the accord requires is that the teams comply with laws covering minimum wages and overtime.

According to their lawsuit, players earn $3,000 to $7,500 a year in the minor leagues, despite working 50 to 70 hours a week during the five-month season.

By contrast, the average MLB player makes more than $4 million a year and can’t be paid less than $700,000, according to a study of baseball contracts by the Associated Press.

The players filed their class-action lawsuit in 2014 on behalf of minor leaguers of all 30 Major League teams. In their suit, they described the MLB as a “cartel” and accused it of violating federal laws requiring fair wages and overtime.

The MLB rejected the players’ claims but said it had been planning to raise pay for the minor leaguers.

In 2020, the US Supreme Court rejected the league’s request to decertify the class action.

The parties announced in May that they had reached a settlement but didn’t disclose the terms.

The case is Senne v. Office of Commissioner of Baseball, 14-cv-00608, U.S. District Court, Northern District of California (San Francisco).

Photo: A detail of baseballs during a Grapefruit League spring training game between the Washington Nationals and the New York Yankees at FITTEAM Ballpark of The Palm Beaches on March 12, 2020 in West Palm Beach, Florida. Many professional and college sports, including the MLB, are canceling or postponing their games due to the ongoing threat of the Coronavirus (COVID-19) outbreak. Photo by Michael Reaves/Getty Images.