Bedouin protesters carry an al Qaeda flag that reads: "There is no God but God and Mohammad is his messenger" as they condemn a U.S. produced movie insulting Islam's Prophet Mohammad,near an international observer base located near El Gorah, in Sinai September 14, 2012. REUTERS/Stringer

DUBAI (Reuters) - Al Qaeda’s affiliate in North Africa urged Muslims to kill representatives of the U.S. government in the region in retaliation for a film that mocks the Prophet Mohammad, saying it welcomed last week’s revenge killing of the U.S. ambassador in Libya.

“We congratulate our Muslim rebel brothers who defended our Prophet’s honor... and we tell them: the killing of the U.S. ambassador is the best gift you give to his arrogant unjust government,” al Qaeda in the Islamic Maghreb (AQIM) said in a statement posted on Tuesday on a website used by militants.

AQIM, al-Qaeda’s North African arm, urged Muslims, particularly in Algeria, Tunisia, Morocco and Mauritania, to “kill U.S. ambassadors and representatives or to kick them out and purify our land from their filth to avenge” the Prophet’s honor.

The film “Innocence of Muslims”, clips of which were posted on the Internet, portrays the Prophet Mohammad as a womanizer and has provoked an outcry among Muslims and triggered violent attacks on embassies across North Africa and the Middle East.

Four U.S. officials including the ambassador to Libya, Christopher Stevens, were killed in the east Libyan city of Benghazi last Tuesday after anger over the film boiled over.

U.S. and other foreign embassies were stormed in other cities in Asia, Africa and the Middle East, and on Saturday, Afghanistan’s Taliban claimed responsibility for an attack on a base which killed two U.S. Marines, saying it was in response to the film.

At least 17 people have been killed since Tuesday in the violence, which prompted Washington to send troops to bolster security at its missions.

AQIM emerged out of Algeria’s civil conflict but it has gradually expanded south into the Sahara and has raised its profile in recent years, partly through hit-and-run attacks on regional armies but mainly by kidnapping Westerners for ransom.

(Writing by Rania El Gamal; Editing by John Stonestreet)