TEHRAN – Mahmoud Ahmadinejad was sworn in as Iran's president Wednesday in a ceremony boycotted by reformist leaders and parliamentarians and marred by street protests over his victory.

The 53-year-old hard-liner took his oath of office nearly eight weeks after a disputed election that unleashed the worst unrest since the 1979 Islamic revolution and divided the political and clerical elite.

Ahmadinejad said Iran wanted peaceful coexistence with the world but would resist any bullying power.

Internationally, we seek peace and security. But because we want this for all of humanity, we oppose injustice, aggression and the high-handedness of some countries, he said.

Riot police were out in force in nearby streets. Witnesses said hundreds of supporters of Ahmadinejad's main political rival, Mirhossein Mousavi, gathered near parliament but no clashes with the police and Basij militia broke out.

Police arrested at least 10 protesters, a witness said.

Former presidents Mohammad Khatami and Akbar Hashemi Rafsanjani, who support Mousavi, boycotted the inauguration. The official IRNA news agency said most of parliament's 70 reformist legislators also stayed away.

U.S. President Barack Obama and the leaders of France, Britain, Italy and Germany have all decided not to congratulate Ahmadinejad on his re-election although the White House acknowledged that Ahmadinejad was Iran's elected leader.

We sent neither flowers nor a message of congratulations, a German Foreign Ministry spokesman said, adding that Germany had sent a junior official to observe the ceremony.

It's quite clearly a signal and we assume that it's being understood as a signal, the spokesman said.

Ahmadinejad reacted tartly to the Western cold shoulder.

We heard that some of the Western leaders had decided to recognize but not congratulate the new government, he said. Well, no one in Iran is waiting for your messages.

Iran is at odds with the West over its nuclear program, which the United States and other powers say is aimed at building an atomic bomb. Tehran says the program is for peaceful energy purposes.

Ahmadinejad has two weeks to present a cabinet to parliament for approval but may get a rough ride from the conservatives who dominate the assembly, as well as from his moderate foes.

Mousavi and reformist cleric Mehdi Karoubi say the next government will be illegitimate -- defying Supreme Leader Ayatollah Ali Khamenei, who has formally endorsed Ahmadinejad.

Ahmadinejad has also come under fire from some hardliners angered by his initial choice of Esfandiar Rahim-Mashaie as his first vice-president. They were further upset when he took a week to obey Khamenei's order to dismiss Mashaie.

Nevertheless, Khamenei described Ahmadinejad as courageous, hardworking and wise at the ceremony Monday.

At least 20 people have been killed since the June 12 election and hundreds have been arrested.

The authorities opened a mass trial Saturday for more than 100 reformists on charges of inciting unrest. The next session of what Khatami and Mousavi have denounced as a show trial will take place Thursday.

Iran accuses the West, particularly the United States and Britain, of having fomented trouble after the election, which officials describe as the healthiest in the Islamic Republic's history, in an attempt to topple clerical rule.

Enemies tried to question the election's validity, Ahmadinejad said after taking the oath.

(Writing by Alistair Lyon; editing by Angus MacSwan)