From Comcast SportsNet LOS ANGELES (AP) -- Embattled Los Angeles Dodgers owner Frank McCourt and Major League Baseball reached an agreement late Tuesday to sell one of the sport's most storied franchises, ending a seven-year run that included four trips to the postseason before recently becoming mired in legal troubles capped by a filing for bankruptcy protection. A joint statement said there will be a "court-supervised process" to sell the team and its media rights to maximize value for the Dodgers and McCourt. The Blackstone Group LP will manage the sale, which could include Dodger Stadium and the surrounding parking lots. The announcement came as the Dodgers and MLB were headed toward a showdown in U.S. Bankruptcy Court in Delaware at the end of the month as mediation between both sides was ongoing. McCourt and baseball Commissioner Bud Selig have traded barbs since MLB took control of day-to-day operation of the team in April over concerns about the team's finances and the way it was being run. McCourt apparently realized a sale of the team he vowed never to give up was in his best interest and that of the fans. "There comes a point in time when you say, It's time,'" said a person familiar with the situation who requested anonymity because details of the negotiations had not been made public. "He came to that realization at the end of today." McCourt filed for bankruptcy protection in June after the league rejected a 17-year TV contract with Fox, reported to be worth up to 3 billion, that he needed to keep the team afloat. Selig noted that almost half of an immediate 385 million payment would have been diverted from the Dodgers to McCourt. The franchise's demise grew out of Frank McCourt's protracted divorce with Jamie McCourt and the couple's dispute over the ownership of the team. The divorce, which played out in public in court, highlighted decadent spending on mansions and beach homes and using the team as if it were their personal credit card. They took out more than 100 million in loans from Dodgers-related businesses for their own use, according to divorce documents. In bankruptcy filings, attorneys for MLB said McCourt "looted" more than 180 million in revenues from the club for personal use and other business unrelated to the team. "The Dodgers are in bankruptcy because Mr. McCourt has taken almost 190 million out of the club and has completely alienated the Dodgers' fan base," the baseball attorneys wrote. As the former couple continued to fight over ownership of the team, the Dodgers' home opener against the rival San Francisco Giants kicked off a year of even worse publicity. A Giants fan, Bryan Stow, was nearly beaten to death in the parking lot. Stow's family has sued the Dodgers, and his attorney said medical bills could reach 50 million. In the outpouring of public sympathy, attention focused on cutbacks in security at Dodger stadium and fans turned their animosity toward Frank McCourt. Scores of police were dispatched to patrol the stadium after the attack. Dodgers attorneys claimed Selig deliberately starved the club of cash and destroyed its reputation in a bid to seize control of the team and force its sale. "As the commissioner knows and as our legal documents have clearly shown, he approved and praised the structure of the team about which he belatedly complains," the team said in a statement. The team was asking Judge Kevin Gross in Delaware to approve an auction of the team's television rights as the best path to exit bankruptcy. But the league wanted to file a reorganization that called for the team to be sold. Last month, Jamie McCourt cut a deal with her ex-husband to settle their dispute over ownership of the team they bought in 2004 for about 430 million. The terms of the settlement between the McCourts weren't disclosed publicly, but a person familiar with it who requested anonymity because it's not meant to be public told The Associated Press that Jamie McCourt would receive about 130 million. She also would support the media rights deal worth up to 3 billion. That removed her from the number of opponents Frank McCourt was facing in bankruptcy court because Jamie McCourt had initially lined up behind MLB and Fox in asking the bankruptcy court to reject his bid to auction Dodgers television rights. All the bad publicity appeared to drive fans away. There was a 21 percent drop in home attendance from last season and it was the first time in a non-strike year since 1992 that the Dodgers drew fewer than 3 million people. A new owner would be the third since Peter O'Malley sold the team to News Corp. in 1998. The Dodgers had remained in the O'Malley family since Walter O'Malley moved the team from Brooklyn to Los Angeles in 1958. The Dodgers finished this season with an 82-79 record.