The El Mundo newspaper reported earlier that its war correspondent Javier Espinosa made contact late Saturday from Turkey, where he and photographer Ricardo Garcia Vilanova were under military protection.
It was not clear whether the journalists had escaped or were released by the extremist Islamic State in Iraq and the Levant, which abducted the pair at a checkpoint in northeastern Syria on Sept. 16 as they were trying to leave the country.
Syria ranks as the most dangerous country in the world for reporters. Nearly 30 journalists have been killed there since the conflict began in March 2011, while dozens more have been kidnapped by both rebels and pro-government forces.
Most of the kidnappings in the past year have taken place in rebel-held territories, particularly in chaotic northern and eastern Syria, where the Islamic State has a presence.
With the two Spanish correspondents now free, there are at least nine more foreign reporters still missing in Syria as well as 10 Syrian journalists.
For friends and family, word of the journalists' freedom was reason to rejoice after months of stress. Monica Garcia Prieto, Espinosa's partner, put it simply in a succinct Tweet: "Pure happiness."
The two journalists were to flying back to Madrid Sunday on a Spanish government aircraft, and were due to arrive by midafternoon, the Defense Ministry said.
A spokeswoman for the Foreign Ministry said the government uses "maximum discretion" when dealing with kidnapped journalists, and would not comment on whether a ransom was negotiated. She spoke on condition of anonymity in line with regulations.
Journalists are not the only ones who have been targeted for kidnapping. Activists, who do much of the on-the-ground reporting in Syria, are also at risk. Reporters Without Borders says around 20 activists are held by the Islamic State, while an unknown number are held by the government.
The Hanein Network, a militant website that carries al-Qaida statements, issued a plea to the Islamic State in December to release Espinosa and Garcia Vilanova, describing them as "men who risked their lives to report the truth."
Its home page shows the Spaniards in a soft-focus background. A masked militant of the Islamic State stands in the foreground, holding two cats, in an apparent sentimental appeal for clemency.
Another Spanish reporter who was seized by the Islamic State in September, Marc Marginedas, was released earlier this month.
Hadid reported from Beirut. With reporting by Maamoun Youssef in Cairo.