By Marwan Makdisi

DAMASCUS (Reuters) - Bashar al-Assad was sworn in on Wednesday as Syria's president for a new term, after an election his opponents dismiss as a sham but his supporters say proves that a rebellion to unseat him has failed after three years of war.

After taking the oath of office before a Koran and a copy of the constitution, the president of 14 years delivered a defiant speech, vowing to recover all Syria from Islamist insurgents.

Looking calm and confident, he repeatedly took aim at the West and Sunni Muslim Gulf Arab monarchies who have funded and armed the rebels that have taken control of much of the north and east of the country but failed to topple him in Damascus.

"Soon we will see the Arab, regional and Western states that supported terrorism pay a high price," he said in the speech at the presidential palace in Damascus, broadcast on state TV.

The Syria war has been the battleground for a sectarian struggle between groups supported by Sunni Muslim states including Saudi Arabia and Qatar, and Assad's government backed by Shi'ite Iran.

Last month it spread dramatically to Iraq, where an al Qaeda offshoot called the Islamic State in Iraq and the Levant (ISIL) surged across the border, seized cities, changed its name to the Islamic State and declared its leader ruler of all Muslims.

ISIL has officially been rejected as a terrorist group by the Gulf states that support other Sunni fighters in Syria, but Damascus, Baghdad and Tehran all blame the Gulf kingdoms for supporting the wider Sunni militancy that feeds it.

Since advancing in Iraq, ISIL has also expanded its reach in Syria, using weapons seized from the fleeing Iraqi army to fight against rival rebel factions in Syria.

STILL STANDING

Assad took power in 2000 after the death of his father Hafez who ruled for three decades. He has held firmly onto control in Damascus since the revolt began, defying confident predictions by Western leaders, including U.S. President Barack Obama, that he would be swiftly toppled.

The revolt, which began with pro-democracy protests in 2011 that Assad dismissed in his speech as the "fake Arab Spring", rapidly descended into sectarian civil war in which more than 170,000 people have been killed. According to the United Nations, 10.8 million Syrians now urgently need aid.

Western countries lined up from the outset behind the rebels that opposed Assad, but unlike in the case of Libya, where NATO warplanes helped bring down dictator Muammar Gaddafi, they have refused to provide overt military support.

Although the rebels made early gains, Iran and Lebanon's powerful Hezbollah Shi'ite militia came to the aid of Assad's forces, helping them reclaim territory.

Meanwhile, the rise of Sunni jihadists like ISIL among the rebels has dampened Western enthusiasm for aiding Assad's enemies, led to infighting within the rebel ranks and bolstered Assad's assertions that his government is fighting extremism.

Obama threatened air strikes last year after blaming Assad for a poison gas attack that killed hundreds of people in a Damascus suburb. But the United States called off the operation when Assad agreed to give up chemical arms, effectively ending any threat that the West might use force to remove him.

Western countries dismissed last month's election as a sham, but Assad's victory affirmed him in power and shut down any talk of a negotiated settlement that would see him step aside.

"I repeat my call today to those who were misled to put down their guns, because we will not stop fighting terrorism and striking it wherever it is until we restore security to every spot of Syria," said Assad.

Assad's inauguration featured the display of carefully orchestrated adulation that has been typical of his infrequent public appearances since the start of the war. Dressed in a dark suit, he arrived at the presidential palace in a black car and walked down a red carpet as a military band played music.

Assad's government says the election is proof of its willingness to enact democratic reforms. He ran against two other candidates, making it the first contested presidential election in Syria's history, after four decades of referendums to approve the appointment of Assad and his father. Official returns gave him 88.7 percent of the vote.

(Additional reporting by Sylvia Westall, Laila Bassam and Mariam Karouny and Tom Perry; Writing by Tom Perry; editing by Ralph Boulton)