They did not provide further details in a post on X but Spanish media said there were 82 people inside when the blaze broke out at around 5:00 am (0400 GMT) due to unknown causes.
The mayor of the town, Volga Ramirez Gamiz, told reporters that the fire was concentrated in one room, but the smoke spread throughout the residence.
“Fortunately that room has a security door,” which prevented the fire from spreading, she said.
The central government’s representative in the Aragon region, Fernando Beltran, told reporters the causes of the deaths were under investigation but likely due to smoke inhalation.
The head of the Aragon government, Jorge Azcon, said he was “shocked” and was “suspending public engagements as a sign of mourning.”
The Jardines de Villafranca residence was opened in 2008 as a home for the elderly but had recently specialised in elderly people with mental health problems.