Swampscott fire Capt. Kevin Thompson arrived to 2 Superior Street about 12:15 p.m. Wednesday and saw three-foot flames rising from a mattress in the rear bedroom.
The flames may have been sparked by a cigarette, he said.
Swampscott firefighters toting fire hose entered the front door of the two-and-a-half story house and extinguishing the fire, the captain said.
"A good knock-down," he said.
They contained the fire to the bedroom, getting there just in time to stem the spread of flames in the circa 1895 home.
"Another minute or so and we'd still be fighting the fire," he said, right before the crews headed back to the fire station.
The occupant of the first floor was taken to a local hospital to be evaluated for smoke inhalation.
She was walking on her own, officials said.
The woman rents from the owners and her first floor apartment received smoke and fire damage.
Swampscott Deputy Chief James Potts said the first floor would need work before the tenant could move back in.
An owner lives on the second floor and would be able to stay there, the deputy chief said.
The home at 2 Superior St., near the Lynn line, is owned by Jeffrey and Carol Duclos and Michael Butler, according to the town assessor's web page.
Fire companies from Lynn and Marblehead helped Swampscott fight the fire.
The home is in a residential neighborhood of two- and three-story homes near the Swampscott Train Station.
This was the second fire in two days that the Swampscott Fire Department responded to.
On Tuesday Swampscott crews helped Nahant firefighters battle a blaze.