NEW YORK (AP) — Just as a trial was to begin, Major League Baseball and a group of its fans who had sued reached agreement Tuesday to expand the menu of online packages for televised games and lower prices.

The deal came weeks after baseball's lawyers said for the first time the league was going to let fans buy single-team online TV packages. In the past, viewers who didn't live in their favored teams' home markets had to buy access to every televised MLB game included in the national plan.

Lawyers for fans who filed the class action lawsuit in 2012 said MLB will offer unbundled Internet packages for the next five years, including single-team packages for $84.99 next season. They said that's a 23 percent drop from the cheapest version previously available.

The deal also calls for the cost of a league-wide package to drop to $109.99. The agreement provides other options to cable subscribers to regional sports broadcast networks. The league will let a subscriber buy access to a visiting team's broadcast online. MLB also agreed to provide live local team broadcasts over the Internet for cable subscribers by the start of the 2017 season.

In most instances, a subscription to a team's cable outlet is necessary to view games online, though the agreement contemplates eventually enabling some fans to watch games online without traditional cable subscriptions.

"We believe this settlement brings significant change to the sports broadcasting landscape," said Ned Diver, a plaintiffs' lawyer. "It is a big win for baseball fans."

Major League Baseball confirmed the settlement but said it could not comment further because "the process remains ongoing."

NBC Sports Regional Networks said in a statement it was pleased with the deal.

The trial had been scheduled to start Tuesday in Manhattan federal court, though officials indicated last week a settlement was likely.

Recently, MLB's lawyers said they would change their sport's packages similar to what the National Hockey League undertook when it settled its side of the lawsuit last year. The NHL also agreed to let fans buy single-team packages.

In 2013, U.S. District Judge Shira Scheindlin ruled baseball could not use its antitrust exemption as a defense.

The lawsuit had said that the leagues' clubs and some television broadcast entities colluded to eliminate competition in the airing of games on the Internet and on television. Baseball had defended a decades-old system of regional television contracts designed to protect each baseball team's area from competitors.

More recently, baseball has multiplied options for fans so they could view games on various electronic devices.

"Make no mistake, this mission is not altruistic," baseball's lawyers said in court papers. "Baseball faces fierce competition, including from other sports offerings and an increasing slate of non-sports entertainment and leisure options."

Diver, the plaintiffs' lawyer, had argued that dividing the country into geographic territories for each team had strengthened baseball's monopoly and permitted it to overcharge fans.

___

AP Baseball Writer Ron Blum and Associated Press writer Tom Hays contributed to this report.