Two Spanish journalists kidnapped in northern Syria last September have been freed by their captors, ending a six-month ordeal in the hands of an extremist Islamist group that continues to hold more than 40 other western hostages.

Javier Espinosa, a veteran correspondent for the Spanish daily El Mundo, and Ricardo García Vilanova, a freelance photographer working with him, were handed over to Turkish authorities on Saturday night near the Syrian town of Tal Abiyad, not far from where they were seized 194 days ago.

The pair had been held in the nearby city of Raqaa, which fell to the Islamic State of Iraq and the Levant (Isis) last May and remains a stronghold of the radical organisation even after an internecine fight with other Syrian opposition groups, who ousted them from nearby Idlib and Aleppo province over the past month.

It is widely believed that the bulk of the remaining hostages, comprising journalists, aid workers and priests, have also been imprisoned in Raqaa since their capture, or were moved there recently, as Isis forces retreated east with rebels in pursuit.

The scale of the hostage crisis in northern Syria, in terms of the numbers held and length of their detention, exceeds most other similar incidents anywhere in the world in recent decades. The victims come from at least 10 countries, including the US, France, Italy, Belgium, Sweden, Denmark and Peru.

Javier Espinosa (right) and Ricardo Garcia Vilanova in May 2012: they were handed over near Tal Abiyad, not far from where they were seized 194 days ago. Photograph: Joan Borras/AP

Until recently, there had been no communication with the hostage-takers or their proxies, and their demands had been unclear. Even after intensive efforts by European governments to make contact, no key co-ordinating figure within Isis has emerged. The fate of the captives seems contingent on the whim of local warlords.

The jihadists holding the hostages are thought to be senior figures within the organisation, which has influence over a vast swath of territory from Falluja in Iraq, through Syria's eastern deserts and oil fields, and on to Raqaa and al-Bab in eastern Aleppo province.

Throughout 2013, Isis gained a foothold in Aleppo and Idlib, imposing hardline Islamist rule in towns and cities it had conquered, often through brutal, indiscriminate violence. Hostage-taking became a tool to impose both fear and influence. Prisoners were also seized in a bid to trade them for Islamist prisoners held in Syria and elsewhere.

Some hostages have been held for more than 18 months. Others, including five European doctors from aid group Médecins sans Frontières, were captured this year in northern Latakia. A group from the International Committee of the Red Cross was seized last October.

The families of many of those held have avoided publicising their cases, fearing a raised profile may amplify their kidnappers' demands. Others, such as Espinosa's wife, Mónica García Prieto, had chosen to make public appeals directly to his captors in the hope that personalising his ordeal would advance his release.

Espinosa had reported from the Middle East for much of the past 12 years and had worked extensively among opposition communities in northern and western Syria. He narrowly escaped death in Homs in February 2012, when a rocket fired by the Syrian army hit the house in which he and other reporters were staying, killing Sunday Times correspondent Marie Colvin and French photographer Remi Ochlik.

Both Spaniards were reported to be in good health. Espinosa contacted his newspaper after crossing the Turkish border. He also spoke to his wife, who in response tweeted: "Pure happiness."

After initially doing little to respond to the creeping influence of Isis in northern Syria, Turkey has in recent months attempted to stop the group's recruits from using its borders to cross into Syria.

Ankara also allowed new weapons and ammunition into the country that were used by the two main opposition groups to fight Isis in a series of battles from early January, which eventually led it to withdraw to Raqaa.

The toll, however, was high, with up to 2,500 opposition fighters thought to have been killed and the Syrian military and its backers able to make strategic advances around the eastern flank of Aleppo, which had remained an opposition bastion for 18 months.

The regime's advance saw troops close in on the Sheikh Najjar industrial area in the city's north-east, which was being used as a base for one group of hostages, who were quickly evacuated by their captors.

The changing face of the battlefield has added a new complexity to attempts to free the hostages. Rebel groups who were attempting to monitor their movements have next to no influence in Raqaa and little means to stop them being moved further east into Iraq.

Syria's eastern deserts have descended into a lawless and lethal tract of land under the sway of competing tribes and warlords. Militants, including Isis leaders, move regularly between Iraq's Anbar province and Syria across a porous, and increasingly irrelevant border, between the two countries.

The Iraqi cities of Falluja and Ramadi are again in the grip of an extremist insurgency, less than three years after US forces left the country. The revitalised insurrection there is in turn fuelling the potent Isis presence in parts of Syria. Iraqi officials estimate that there are 6,000 Isis-aligned fighters in Anbar. European and US officials assess that the group's ranks in Syria number 12,000-15,000.

However, Syrian opposition and European officials say Isis can no longer command the influence it has had for much of the past year over parts of northern Syria.

"As strong as they are in numbers, they have taken several strategic blows recently," one senior western official said. "They have been defeated in much of the north, and they will not be coming back there. The battle has been won. The regular opposition can now get back to fighting Assad."