Three Spanish freelance journalists held captive in Syria for nearly 10 months returned home Sunday, tearfully hugging relatives as they got off a military jet sent to Turkey to bring them back.

Antonio Pampliega, Jose Manuel Lopez and Angel Sastre shook hands with Deputy Prime Minister Soraya Saenz de Santamaria on the tarmac of the Torrejon de Ardoz air force base on the outskirts of Madrid. They then smiled and cried as relatives ran to hug them.

Images on Spain's state-owned TVE television channel showed their arrival but reporters were kept outside the base and away from the three journalists, only catching sight of a dark blue van carrying them from the base.

Prime Minister Mariano Rajoy posted a photograph of the journalists descending from the aircraft with a caption saying "Welcome!" on his official Twitter account.

"Allied and friendly" countries had assisted in ensuring the journalists' release, his office said in a statement late Saturday.

It highlighted Turkey and Qatar, saying they had helped out "especially in the final phase" of the journalists' liberation.

It provided no information on the captors and how they were convinced to give up the journalists.

The three journalists went missing on July 12, near the city of Aleppo in northern Syria. At the time, the region was under the control of al-Qaida's branch in Syria known as the Nusra Front.

The journalists, who provided news to several media outlets, had traveled to Syria to report on the war that had broken out there in 2011.

All three were experienced freelance journalists who had worked in Syria before and knew what type of precautions they would need to take, according to Elsa Gonzalez, president of Spain's federation of journalists.

Saenz de Santamaria spoke to the journalists by telephone on Saturday evening.

Three other Spanish journalists were released in March 2014 after being held hostage by Syrian extremists for months.

The Spanish government has never given details of how it secured the releases.