BANJUL (Reuters) - Gambia's President Yahya Jammeh on Friday declared the formerly secular country an Islamic republic in a move he said was designed to distance the West African state further from its colonial past.

The tiny sliver of a country, named after the river from which British ships once allegedly fired cannonballs to fix its borders, joins the ranks of other Islamic Republics such as Iran and Afghanistan.

"In line with the country's religious identity and values, I proclaim Gambia as an Islamic state," said Jammeh on state television. "As Muslims are the majority in the country, the Gambia cannot afford to continue the colonial legacy," he added.

Gambia's population of 1.8 million people is 95 percent Muslim. He said that other citizens of other faiths would still be able to practise.

Jammeh, an animated orator who has earned the reputation for making surprise declarations over the course of his 21-year presidency, pulled Gambia out of the Commonwealth in 2013, calling it neo-colonial. In 2007, he claimed to have found a herbal cure for AIDS.

Despite strong commercial ties with Britain and other European countries whose citizens are regular visitors to Gambia's white-sand beaches, relations with the West have deteriorated in recent years.

The European Union temporarily withheld aid money to the country last year over Gambia's poor human rights record. Gambia, whose main industries are agriculture and tourism, ranks 165 out of 187 countries on the U.N. development index.

"Starved of development funds because of his deplorable human rights record and economic mismanagement, Jammeh is looking towards the Arab world as substitute for and source of development aid," said blogger Sidi Sanneh, a former foreign minister who has become a U.S.-based dissident.

(Writing by Emma Farge; Editing by James Dalgleish)