FILE PHOTO: People look at an artwork depicting QatarÕs Emir Sheikh Tamim Bin Hamad Al-Thani during the Winter Festival at Katara Cultural Village in Doha, Qatar, January 18, 2018. REUTERS/Naseem Zeitoon//File Photo

DOHA/N’DJAMENA (Reuters) - Chad and Qatar have restored diplomatic relations, their governments said, six months after the West African nation cut ties with Doha in the wake of a rift among Arab states.

Chad closed Qatar’s embassy and expelled its diplomats last August, accusing its government of trying to destabilize Chad via its northern neighbor, Libya.

The move came after Saudi Arabia, the United Arab Emirates, Bahrain and Egypt cut diplomatic and commercial ties with Qatar in June for allegedly supporting extremist groups, meddling in their internal affairs and backing regional foe Iran’s agenda.

Qatar denied all the accusations.

In a statement reported by the Qatari state news agency QNA, Qatar’s foreign ministry said the two countries’ foreign ministers signed a memorandum of understanding on Tuesday to resume diplomatic relations.

“A victory for both countries’ diplomacy; one that is based on the principles of dialogue & common interests that bring peace and prosperity to both nations,” foreign ministry spokeswoman Lulwa Rashed al-Khater wrote on Twitter.

A spokesman for Chad’s foreign affairs ministry confirmed relations would be restored.

West African countries Niger, Mauritania and Senegal also cut ties with Doha last year in solidarity with the other Arab countries.

Senegal reinstated its ambassador to Qatar in August in a bid to encourage the Arab states to resolve their dispute. Qatar, however, remains isolated by trade and travel sanctions imposed by its neighbors.