By Nailia Bagirova

BAKU (Reuters) - Azerbaijan closed an independent television station on Friday that planned to air an interview with Fethullah Gulen, the Muslim cleric whom Turkey accuses of orchestrating a failed coup attempt earlier this month.

Azerbaijan has close ties with Turkey and Ankara has consistently supported Baku in a conflict with Armenian-backed separatists over its breakaway Nagorno-Karabakh region.

The Azeri court of appeal revoked the license of ANS television station based on a lawsuit filed by the National Television and Radio Council (NTRC). The law allows authorities to close media deemed to be broadcasting extremist propaganda or discriminating on ethnic grounds, amongst other offences.

"ANS took a position that contradicted the strategic partnership between the Azeri and Turkish people by offering support to Fethullah Gulen and his supporters, who organized the bloody events that led to multiple deaths," NTRC said in a statement.

Turkish President Tayyip Erdogan has said his former ally Gulen, who has a wide following in Turkey, masterminded the July 15 coup attempt and headed a network within the army, police, judiciary, civil service, media and the education sector to control the state.

Gulen, who has lived in self-imposed exile in the United States since 1999, denies the accusations and says the coup may have been orchestrated by Erdogan himself.

An ANS correspondent in Washington recorded an interview with Gulen shortly after the events in Turkey, but it has not been broadcast.

ANS TV is owned by three Azeri businessmen and is widely seen as independent in the oil-rich country, where President Ilham Aliyev is accused by opponents of muzzling dissent and jailing his critics.

Baku says the country - a mainly Muslim former Soviet republic of 9 million people whose language is close to Turkish - enjoys full freedom of speech and a lively opposition media.

Representatives for the station said the court's decision was undemocratic and they planned to file an appeal.

"ANS was the only TV channel which did not belong to any oligarch in the country," Azer Gasymov, an independent analyst, told Reuters.

"The channel's closure could be assessed as a political order as there is no evidence that it has any links to Fethullah Gulen."

(Writing by Margarita Antidze; Editing by Jack Stubbs and Tom Heneghan)