When two stowaways, Jeff Peters and Orville "Turkey" Jackson, accidentally cause a freighter to explode off the coast of North Africa, they float to shore on a makeshift raft, encounter a camel, and ride it across the desert to Morocco. Once there, they spend their time trying to get food without money until Jeff sells Orville into slavery for two hundred drachmas. Orville is carried away by his Arabian owner, and Jeff is unable to locate him. When someone directs Jeff to the palace at the end of a street, a note from Orville floats down from the wall, advising him that he is being tortured and that Jeff should give up the search and flee the city for his own safety. Jeff instead climbs the palace wall and finds his friend dressed like a prince and being "tortured" by the caresses of the Princess Shalmar. Orville is deliriously happy that Shalmar has chosen to marry him and resents Jeff's intrusion, but Shalmar immediately falls in love with Jeff and invites him to stay for the wedding. Unknown to both men, Shalmar has decided to marry Orville, rather than Mullay Kasim, her real fiancé, because her prophet has determined that her first husband will die violently within the first week of marriage. Orville backs out of the marriage when he learns the truth from a harem girl who is in love with him, and when the prophet later reveals that his forecast was erroneous because of some insects in his telescope, Shalmar then chooses to marry Jeff. Jeff, Orville, Shalmar and the harem girl try to flee the city, but an angry Kasim kidnaps them. After leaving the men for dead in the desert, Kasim takes the women to his encampment. Jeff and Orville wander through the desert and see mirages of a drive-in hamburger stand and an alluring singing image of Shalmar until they stumble on an oasis near Kasim's camp. They are captured and imprisoned by Kasim, who refrains from killing them only because it is his wedding night. Jeff and Orville outwit their guards and escape, then wreak havoc on the wedding party by poking holes in the drinking cup of the guest of honor, a former enemy of Kasim, putting gunpowder in the cigarettes, and igniting the guests's clothing. Kasim's angry guest declares war, and a huge brawl erupts in the tent, which Jeff and Orville cause to collapse. Jeff, Orville, Shalmar and the harem girl then escape on horseback, eventually boarding an ocean liner for the United States. When Orville lights a cigarette, he mistakes the "Powder Room" for the bathroom and causes the ship to explode. The two couples raft the rest of the way to New York City.