With the Maryland thoroughbred industry as close as ever to demise, Gov. Martin O'Malley on Wednesday brokered a last-minute deal that guarantees live racing next year at Laurel Park and Pimlico Race Course and ensures the storied Preakness Stakes will continue here.

Owners of the state's two major thoroughbred tracks and industry representatives for horse owners, breeders and trainers agreed to a framework that would allow the tracks to at least break even financially and run races on 146 days in 2011, the same as this year's schedule.

The deal came during a one-hour meeting attended by O'Malley at the State House Wednesday morning — less than 24 hours after the various stakeholders traded contentious words Tuesday night at a meeting of the Maryland Racing Commission, which rejected a proposed schedule for the second time in a month.

By Wednesday afternoon, the racing commission unanimously approved the agreement, which calls for the Maryland Thoroughbred Horsemen's Association and the Maryland Horse Breeders Association to contribute $1.7 million and the state to provide $3.5 million to $4 million to help pay for track operations. The state's contribution will be funded by slot-machine revenue earmarked for track improvements.

Commissioner John McDaniel said of the agreement: "Obviously, it's much improved."

While the racing industry's future is secure for next year, the horsemen and track owners say hard work remains to ensure the long-term viability of a sport that has seen attendance and wagering decline for at least a decade, especially as neighboring states opened casinos years before Maryland.

The Maryland Jockey Club, which runs the tracks, has been hemorrhaging money for several years. Laurel Park, for instance, has been losing $4 million to $7 million annually, while Pimlico's profit comes almost entirely from the Preakness, the second leg of racing's Triple Crown and the state's single largest sporting event. The Preakness, which contributes $40 million to the state economy, is scheduled for May 21.

"When you talk about the long-term plan for racing, there are a host of issues, particularly in the environment we are in now and the changes that have occurred in the past seven weeks," said Alan Foreman, attorney for the Maryland Thoroughbred Horsemen's Association.

The horse-racing industry has bemoaned the fact that Laurel Park won't get slots — voters approved a ballot measure seven weeks ago allowing a planned casino at Arundel Mills mall, ending chances for expanded gambling at the track. That prompted the Jockey Club's corporate owners to initially propose cutting next year's racing schedule to 47 days, which met with fierce resistance from the industry and was rejected by the racing commission.

Casino operator Penn National Gaming, the minority owner of the Jockey Club, has vowed to continue pushing for its "ultimate goal" of securing a second slots license in Anne Arundel County, spokesman Eric Schippers said. That process would require a change to the state constitution.

Penn National entered into a joint venture with Canadian real estate company MI Developments to own and operate the Jockey Club in hopes of securing a slots license. By approving next year's racing schedule Wednesday, the racing commission also gave final approval to Penn National's 49 percent ownership stake.

Separately on Wednesday, MI Developments announced it is considering a restructuring that would transfer all of its racing assets, including the Jockey Club, to Chairman and Chief Executive Frank Stronach, a controversial figure in Maryland racing. In exchange, Stronach would give up control of the company.

In the meantime, Schippers said Penn National, along with MI Developments, would work with the horsemen to devise a new business model for racing and seek potential legislative changes, such as a bill that would allow the closure of a training center in Bowie. The Jockey Club expects the Bowie center to lose $2.2 million next year.

The horsemen's group has said it would support closing Bowie if the Jockey Club moves the training center's 650 horse stalls to Laurel Park or Pimlico.

Schippers said the latest compromise for next year's racing schedule gives the track owners and horsemen time to "work together for a long-term plan to restore the viability of racing."

The more conciliatory tone is a reversal from the animosity that had been growing between the track owners and the horsemen. Several racing boosters had called for new ownership of the tracks, accusing MI Developments of mismanagement and Penn National of being interested only in slots revenue.

"We are going to work with Penn and MID because they are the track owners," Foreman said. "We need the time to let everybody settle down."

Tom Chuckas, the Jockey Club's president, acknowledged Wednesday that he had "real doubts" about Maryland racing after the racing commission rejected an earlier proposal Tuesday. "Everyone's ultimate goal is what's good for racing," Chuckas said after the commission approved the new agreement.

Chuckas said racing's stakeholders will begin discussions at the first of the year to devise solutions for the industry's future and to ensure a similar morass doesn't develop next year.