John Brunetti, the South Florida real-estate mogul and horse owner who has owned Hialeah Park for the past 40 years, died on Friday at his Florida home in Boca Raton, according to friends of the family. Brunetti, 87, had recently had a cancerous lung removed and had been in failing health for several weeks.Brunetti, who bred and raced horses under the Red Oak Stable name, most recently visited Hialeah two weeks ago, when a street bordering the track was renamed for him, according to Randall Soth, the general manager of the track. Brunetti had the lung removed this summer, according to the Miami Herald, and told a reporter in December that he was “rounding third base and headed for home.” The son of a real-estate developer who immigrated to New York from Italy, Brunetti purchased Hialeah Park in 1977, adding the track to his own burgeoning real-estate development business. Over the next 40 years, the fortunes of the historic track, widely considered to be one of the most beautiful racing facilities in the world, would rise and fall along fault lines that were exposed by the deregulation of racing dates in South Florida nearly 20 years ago and the expansion of gambling in the Sunshine State.Throughout the first two decades of Brunetti’s ownership, Hialeah and Gulfstream fought over control of the prime winter dates on the South Florida racing circuit, with Gulfstream steadily gaining ground on what were considered the prime, middle, dates, despite Hialeah’s long history as the preferred winter destination for Northern racing stables. In 2001, the state racing commission decided it would no longer approve racing dates, and after a final season of late-winter dates, Brunetti closed the track.Hialeah would lay dormant for the next eight years, with various proposals floated to redevelop the property, to the consternation of racing fans who wanted to see the grandstand preserved. After the state legislature granted the track the authorization to operate slot machines, Brunetti reopened the track for Quarter Horse racing in 2009, despite the fact the stables at the track had been demolished. Brunetti has said that he was first introduced to racing in the 1950s, and that he and his father co-owned the first horse he raced, in 1957. Since 2000, according to Equibase records, horses owned by Brunetti’s Red Oak Stable have won 320 races from 2,093 starts. Red Oak owns Unbridled Mo, a Grade 3 stakes winner trained by Todd Pletcher.In the recent Miami Herald article, Brunetti said that his health problems had led him to focus his efforts on his charity, working through the charitable foundation he started in 1974.“I’m growing my giving the way I grew my business,” Brunetti said. “You have to ask yourself, ‘Where do you get your satisfaction?’ ”