A fire tore through an apartment in one of New York’s swankiest buildings Wednesday, sending smoke wafting through halls trod by residents such as billionaire David Koch, Blackstone CEO Steve Schwarzman and fashion mogul Vera Wang.

The 3 p.m. blaze struck the home of one of the more controversial denizens at 740 Park Ave. — Bernie Madoff bank associate J. Ezra Merkin.

Dozens of firefighters fought the flames, which burned for about an hour and a half on the seventh floor of the 19-story Art Deco co-op between East 71st and 72nd streets, officials said.

“The smoke was really bad — smoke everywhere,” said Josie Ford, who works as a personal assistant in the building, which was the subject of a 2005 book called “740 Park: The Story of the World’s Richest Apartment Building.”

The building was also featured in a documentary called “Park Avenue: Money, Power & the American Dream,” which aired on PBS in November 2012.

The film noted that the building is home to the highest concentration of billionaires in the United States, “while just a few miles away, Park Avenue in the South Bronx is a high-unemployment, high-poverty zone.”

One firefighter suffered a minor injury and two others were treated for smoke inhalation, said FDNY Deputy Chief John Esposito.

Ford said an announcement was made for residents to evacuate, but fire officials said they preferred residents stay in their apartments due to dangers in the stairwell.

“Smoke was everywhere,” said a witness George Nuñez, who was working across the street on scaffolding at the time the fire broke out.

“They had to break all the windows on the seventh floor.”

The building was erected in 1929 by James T. Lee, the grandfather of Jacqueline Kennedy Onassis, who lived there as a child.

Co-ops in the building, which has a fitness center and, of course, a 24-hour staff, are currently on the market. A 12-room duplex is up for $32.5 million, according to StreetEasy.com.

The address has been home to some of the city’s most rich and famous, including John D. Rockefeller.

The FDNY is still investigating how the blaze started.