The song caused a bit of (apparently) unintended controversy. Mozambique is a country in the southeastern part of Africa. After more than 10 years of fighting, it won independence from Portugal on June 25, 1975. This was shortly before the January 5, 1976 release of Desire. The victorious People's Republic of Mozambique were communists.
Despite the lyrics holding almost nothing to validate the notion, many people took the song as a statement of support for the communist rebels. One line in the song says, "people living free," but everything else about the song is simply an idyllic vision of life on the beach, with "couples dancing cheek to cheek" and "magic in a magic land." Even by Dylan's standards of ambiguity and layered meaning, connecting the song to a political statement about communist rebels seems like quite a reach.
Dylan wrote this song with Jacques Levy, a lyricist who is credited on seven of the nine Desire tracks.
Music journalist and Crawdaddy! founder Paul Williams said that the song started out being about Marseille, France, not Mozambique at all. Dylan had visited France for a good while before making Desire.
According to a 2016 piece in The Daily Beast, Mozambique was chosen as the location for the song simply because Dylan and Levy wanted to see how many rhymes they could come up with ending in "–ique."
"Mozambique" was recorded on July 30, 1975 at Columbia Recording Studios in New York City. Seven attempts were made at the song on July 29, but the final version that appears on Desire is the fourth and final take from the 30th.
The song features harmony vocals by Emmylou Harris and violin by Scarlet Rivera; Dylan asked her to play with him based on nothing more than seeing her walk down the street with her violin case in hand. Rivera's violin comes in late at 0:22, missing a couple notes.
"Mozambique" was released as a single on February 17, 1976, with "Oh, Sister" as its B-side.