BERWICK, Maine — Firefighters rescued a deaf man from a back, upstairs apartment early Sunday morning just before flames consumed the five-unit building on Berwick Road, displacing five families.

Another man was in good condition at Massachusetts General Hospital in Boston after he attempted to put out the fire, which was started by his puppy, Deputy Chief Bruce Plante of the Berwick Fire Department said.

Firefighters were called to the old house at 4 Berwick Road at 3:48 a.m., according to Plante.

“When we got there, the left side of the building was pretty much fully involved,” he said. “Everybody got out, but then they told us someone was still in the back apartment, so two of our firefighters went in. The individual was handicapped — he was deaf — and they had to go in and kick in the door and get him and the cat out.”

The man was uninjured, but another man, James Auger, was taken to Wentworth-Douglass Hospital in Dover, New Hampshire, and then to Mass General for treatment of burns to his hands and other areas, Plante said. He was listed in good condition Sunday evening, according to a hospital spokeswoman.

Auger and his wife were apparently burning a candle in their first-floor apartment early Sunday morning when their new puppy tried to jump on their bed, knocking over the candle, according to Plante.

The couple attempted to put the fire out themselves, and went quickly to get water, but when they returned to the room, the fire had spread to a bureau, he said.

“They grabbed the puppy and got out,” he said.

After rescuing the man from the back apartment, firefighters resorted to a “defensive” attack due to the amount of fire.

Crews cleared the scene after 8:30 a.m. Plante said one dog and about six cats died in the fire.

About 17 departments assisted, including approximately 75 firefighters.

A previous version of this story listed an incorrect location for Wentworth-Douglass Hospital, which is in Dover, New Hampshire.