A fire which apparently began in a malfunctioning ceiling fan at the Madison Inn brought a quick response from the Oak Bluffs fire department Tuesday afternoon. Firefighters were able to put out the flames just as the fire burned through the ceiling and began to spread to the exterior, according to Oak Bluffs fire chief John Rose.

The first units on the scene were able to knock down the fire with foam fire extinguishers.

Madison Inn owner Caleb Caldwell said the inn is closed for the winter, and there was no one in the building at the time of the fire. He said his wife Mary Ibsen drove by the building at 18 Kennebec avenue by coincidence at about 2 p.m.

“Mary just happened to stop by the building, found it full of smoke,” said Mr. Caldwell. “One of our employees lives in the manager’s apartment during the winter, but he wasn’t here. Very fortunate. We’re closed for the winter so we’ve got all winter to figure it out.”

Chief Rose said this was the kind of a fire where minutes counted in response to the call.

“A fan in a bathroom caught fire, extended into the building, came up the outside of the building a little bit, and extended into a second floor bedroom a little,” Chief Rose said.

“A few minutes longer and it would have been a whole different fire. You’ve got the wind coming right off the water, and that whole back area where the fire was is exposed.”

Firefighters checked the interior and used large fans to clear smoke.

No one was hurt.