Al Qaeda leader Ayman al-Zawahri called on young Muslim men in the United States and other Western countries to carry out attacks inside them and urged greater unity between militants.

"I call on all Muslims who can harm the countries of the crusader coalition not to hesitate. We must now focus on moving the war to the heart of the homes and cities of the crusader West and specifically America," he said in an audio recording posted online on Sunday, referring to nations making up the Western-led coalition in Iraq and Syria.

He suggested Muslim youth in the West take the Tsarnaev and Kouachi brothers, who carried out the Boston marathon bombings and Charlie Hebdo shootings in Paris respectively, and others as examples to follow.

It was not clear when the recording was made but references to former Taliban leader Mullah Mohamed Omar as being alive suggest it is at least two months old. Omar's death was announced by Afghanistan's government in late July.

Zawahri reiterated his position on Islamic State, repeating what he said in a recording posted on Wednesday - that he viewed the group's claim to be a caliphate as illegitimate but would join them in fighting Western and secular forces in Iraq and Syria.

Former Egyptian doctor Zawahri urged unity between Islamist militant factions in Syria and Iraq, where a Western-led coalition is bombing Islamic State targets, but recognized it would he be difficult. He called for the formation of an independent sharia court to settle disputes.

(Reporting by Ahmed Aboulenein and Omar Fahmy; Editing by Angus MacSwan)