The fire was reported at 2:47 a.m. at an apartment building at 240 Linden Ave. that houses seniors.
The blaze started on the first floor of a three-story building and spread to the second and third floors, Battalion Chief Dave Pucci said.
Smoke detectors alerted residents to the situation and they were able to evacuate safely, Pucci said. No injuries were reported.
The American Red Cross has set up a shelter for the displaced residents at the Fair Oaks Community Center at 2600 Middlefield Road, Red Cross spokesman Jim Mallory said.
The apartment where the fire started was gutted, and two above it sustained fire damage, Pucci said. Many other units were damaged by smoke, but not all are uninhabitable, he said.
"We're going to be able to get some of those folks back in today," Pucci said.
Pucci said the building's smoke detectors were key in preventing injuries or worse.
"It's very, very important to check smoke detectors and batteries," he said. "It saved lives today."
Pucci said about 60 fire personnel were dispatched to the blaze. The response included 11 engines, three trucks and five battalion chiefs.