The fire broke out around midnight Tuesday at the facility in Moncada in Valencia, with six fire engines deployed, the region's firefighters tweeted.
They said "five people are dead", while 11 people were taken to hospital because of smoke inhalation.
Firefighters had to rescue 25 people from the blaze, and all 70 remaining residents were evacuated.
The fire had been brought under control and firefighters were ventilating the premises, they added.
Local media quoted witnesses who described how nursing home workers, together with firefighters and police officers, rescued the elderly through one of the staircases of the two-storey building.
According to the local press, initial investigations indicate the fire may have been caused by a short circuit in an oxygen unit.