Three Spanish freelance journalists who went missing in Syria last year and were believed to have been kidnapped have been released, the Spanish government has said.

The three men – Antonio Pampliega, José Manuel López and Ángel Sastre – disappeared last July. They were working on an investigative report in the northern city of Aleppo, where other journalists have been captured in the past, Spanish media reported at the time.

Spain’s acting deputy prime minister, Soraya Sáenz de Santamaría, had made contact and spoken to the three, a government spokesman said. El País reported the men were now in Turkey and waiting to be brought back to Spain.

No details were immediately available on how the three were released, but Qatar said it had helped. Qatar’s state news agency said the assistant foreign affairs secretary, Sultan bin Saad Martian, had received a phone call from Spain’s foreign affairs minister, Ignacio Ybáñez Rubio, in which he “thanked the state of Qatar for its efforts in the release of three Spanish prisoners who had been detained in Syria”.

Some Spanish media, including El País, say the three were held by al-Qaida’s Syrian wing, the Nusra Front, which is designated by the UN and US as a terrorist organisation.

Qatar has previously mediated the release of foreign hostages held by the Nusra Front in Syria.