Guinea were supposed to host Morocco on Monday but the game was called off following hours of heavy gunfire near the presidential palace in the capital Conakry.
Morocco coach Vahid Halilhodzic told French newspaper L’Equipe that they could hear “gunshots nearby all day”.
Soldiers who staged an uprising in Guinea said on state television that they had dissolved the government and closed the borders. The defence ministry, though, said an attempted takeover of the palace of president Alpha Conde had been thwarted.
The Morocco team, which is captained by Wolves defender Roman Saiss and also includes QPR striker Ilias Chair and Watford duo Adam Masina and Imran Louza, was trapped in its hotel in Conakry as the country's embassy tried to arrange their safe passage out of Guinea.
After hours of uncertainty, the Moroccan delegation and the match officials were given an escort to the airport and flew out late on Sunday.
“Guinea's borders are currently closed, but the Moroccans and match officials were given special authorisation to leave," Cellou Diallo, who reports for Canal+, told BBC Sport Africa.
A joint statement from FIFA and CAF said: "The current political and security situation in Guinea is quite volatile and is being closely monitored by FIFA and CAF.
“To ensure the safety and security of all players and all match officials, FIFA and CAF have decided to postpone the match."