Switzerland has flown an opposition activist out of Azerbaijan after sheltering him for 10 months at its embassy in Baku.

The Swiss Department of Foreign Affairs said Azerbaijani national Emin Huseynov left his country on the plane of Swiss Foreign Minister Didier Burkhalter, who was in Baku to attend the opening of the European Games on June 12.

A department spokesman said the move followed months of negotiations with Azerbaijani authorities.

The 35-year-old journalist and human rights activist has until September to decide whether he wants to apply for asylum in Switzerland.

Huseynov, a fierce critic of authoritarian President Ilham Aliyev, sought shelter at the Swiss Embassy in August after Azerbaijani authorities charged him with illegal entrepreneurship and tax evasion.

The charges against him are widely seen as retaliation for his opposition activities.

Huseynov heads the Baku-based Institute for Reporters' Freedom and Safety, a group that has repeatedly accused Aliyev’s government of restricting free speech.

In 2008, he claimed that he was beaten by police officers in Baku who threatened to kill him and that he was hospitalized due to injuries sustained in the incident.

Switzerland allowed Huseynov to remain at its embassy for "humanitarian reasons."

Huseynov, who is married to a U.S. citizen, reportedly first contacted the U.S. Embassy in Baku but was turned away.

U.S. lawmaker Dana Rohrabacher (Republican-California) has condemned U.S. diplomats in Baku for allegedly refusing to shelter Huseynov.

"It's a sad day when the Swiss are more courageous than the Americans," he told a congressional subcommittee hearing in February.

The inaugurational European Games opened in Baku amid stinging criticism of Azerbaijan's rights record. The lavish opening ceremony was snubbed by European leaders.

Rights groups accuse Aliyev's government of crushing the opposition and using bogus charges to jail regime critics since his election for a third term in 2013.

Aliyev, 53, came to power in 2003 following an election seen as flawed by international observers.

He took over after the death of his father, Heydar Aliyev, who had ruled Azerbaijan with an iron fist since 1993.