The one-alarm blaze was reported at 4:44 a.m. in the 6100 block of Alameda Diablo in the unincorporated community of Diablo.
A husband and wife were asleep in their second-floor apartment in a caretaker's building next to a large house on the property when they woke up and smelled smoke, San Ramon Valley Fire Protection District Battalion Chief Derek Krause said.
The husband got out of bed to investigate and discovered the fire, and both exited the apartment safely.
The wife went to the main house and the husband waited outside for firefighters to arrive, Krause said.
Crews extinguished the blaze, but not before the flames had gutted the upstairs apartment, he said.
The couple was displaced, as was a woman who lives in a downstairs apartment, Krause said.
The cause of the fire remains under investigation, and there is no estimate yet on the dollar amount of damage it caused.
No injuries were reported.