Almost a year to the day since French-Algerian writer Boualem Sansal was arrested on arrival at Algiers airport, the Algerian president has pardoned him and allowed him to leave the country.

Sansal, 81, has been at the centre of a bitter diplomatic row between Paris and Algiers. President Abdelmadjid Tebboune's decision came in response to a direct approach from German President Frank-Walter Steinmeier.

The writer arrived in Germany on a military plane on Wednesday evening and was taken to hospital. French President Emmanuel Macron, who spoke to Sansal by phone, said France had used respect and calm to bring about his freedom.

I thank President Tebboune for this act of humanity, said Macron.

Although Paris had sought to lower tensions with Algeria, it was the German president’s intervention that secured Sansal’s release due to his good relations with Algeria’s leadership.

Steinmeier had requested Tebboune to pardon Sansal, citing the writer’s advanced age and fragile health, allowing him to receive medical treatment in Germany.

Sansal had been sentenced to five years in prison for comments deemed to undermine national unity, particularly related to Algeria's borders.

He has long been a critic of Algeria's government, and the diplomatic crisis had escalated after controversies surrounding French political actions and the treatment of Algerians in France.

Relations between the two nations have been deteriorating, marked by a series of political tensions and disagreements over historical issues and present-day actions.