Iran's supreme leader formally endorsed Mahmoud Ahmadinejad for a second term as president Monday in a ceremony that sought to portray unity among the country's leadership but was snubbed by prominent critics of the disputed election.

After Ayatollah Ali Khamenei gave his official seal of approval, he allowed Ahmadinejad to kiss his robe on his shoulder — a noticeably more restrained gesture than four years ago when Ahmadinejad kissed the leader's hand and cheeks in a sign of closeness and loyalty.

An opposition Web site reported clashes in a northern Tehran square between security forces and protesters. It gave few details however, and could not immediately be independently confirmed.

The meeting cleared the way for Ahmadinejad to take the oath of office Wednesday in parliament, where many pro-reform lawmakers have echoed the claims of fraud in the June 12 election.

Click for photos from Iran.

The ceremony with Khamenei showed vividly the deep political divides confronting Ahmadinejad and his backers among the ruling clerics. The event was boycotted by two former presidents — Akbar Hashemi Rafsanjani and Mohammad Khatami — as well as defeated pro-reform candidates Mir Hossein Mousavi and Mahdi Karroubi, state media reported. Also, no one from the family of Ayatollah Ruhollah Khomeini, leader of the 1979 Islamic revolution, attended.

Iran's main state TV channels did not offer live coverage of the ceremony in an apparent effort by the country's Islamic rulers to avoid emphasizing the boycotts to domestic audiences. But Iran's state-funded channels in Arabic and English broadcast extensive images of Khamenei and Ahmadinejad — possibly seeking to display a sense of high-level solidarity on the international stage.

Khamenei described the June 12 election as a "golden page" in Iran's political history and said it was a "vote for the fight against arrogance and brave resistance to the international domination-seekers" — a clear reference to the United States and its allies — according to comments quoted by state TV.

At the same ceremony four years ago, Ahmadinejad appeared to get a very warm reception from Khamenei. He kissed the supreme leader's hand, then Khamenei drew him close and kissed him on both cheeks with a very benevolent smile.

Monday's exchange was more tentative. Ahmadinejad appeared to approach Khamenei to kiss his hand, but the leader stopped him. The two exchanged words, Ahmadinejad smiled, and then Khamenei allowed him to kiss his robe on his shoulder.

The official state news agency IRNA said Ahmadinejad had a cold, suggesting this was why he didn't kiss Khamenei's hand or cheek and instead kissed his clerical robe.

However, it appeared Khamenei is fully mindful of the public perceptions over every gesture toward Ahmadinejad in the supercharged climate after the election and widespread clampdowns on dissent.

The more cautious approach appeared to seek a middle ground: showing a bond with Ahmadinejad without the elaborate display and deep symbolism of kissing his hand.

Despite Khamenei's repeated praise of Ahmadinejad, the showdowns over his declared victory have reached the highest levels of Iran's leadership and opened unprecedented criticism of Khamenei and the theocracy itself.

Missing from Monday's ceremony was Khomenei's grandson, Hasan Khomeini, who has supported the reformists. Reformist Web sites say he deliberately left Iran to avoid attending this week's inauguration events.

Mousavi and many other leaders of the reform movement had roles in the Islamic revolution or the early years of the system that replaced the Western-backed monarchy. Their current protests have borrowed some of the tactics of the revolution, including shouting Allahu Akbar from rooftops in a nightly protest and using funerals and 40-day memorials for slain demonstrators as rallying points for protests.

An opposition Web site reported clashes Monday afternoon between protesters and special forces in north Tehran's Vanak Square. It said the elite Revolutionary Guard, its allied Basij militia, riot police and special forces had taken up positions around a number of squares and key roads where protesters were gathering. Iranian authorities have barred foreign media from covering street protests.

Wednesday's inauguration could unleash more fierce protests.

In the early months of Ahmadinejad's second, four-year term, Iran faces some important tests.

President Barack Obama has given Iran a September deadline to show a willingness to open dialogue on its nuclear ambitions and other key issues.

Last month, U.S. Secretary of State Hillary Rodham Clinton said the opportunity to talks with Washington "will not remain open indefinitely." The European Union also has signaled that Iran must move quickly to address Western concerns about Tehran's nuclear program — which some fear could lead to atomic weapons. Iran insists it seeks only energy-producing reactors.

The political upheaval could distract or complicate Iran's study of possible contacts with Washington. It also could force the leadership to tone down Ahmadinejad's normally fiery rhetoric and limit his foreign travel to avoid provoking his internal critics.

But Ahmadinejad has given no hints of major policy concessions ahead.

In a July 16 speech, he again vowed to push ahead with Iran's nuclear program. He also said Iran wants "logic and negotiation" with the West but insisted the U.S. apologize for its interference in the elections. Iran, he declared, would become a world power that "will bring down the global arrogance" — one of the phrases often used for the United States.

Iran's leadership is also desperate to show cohesion at home.

Ahmadinejad opened a brief — but potentially disruptive — confrontation with Khamenei's ruling theocracy in late July by refusing to drop his top deputy, Esfandiar Rahim Mashai, who angered conservatives last year when he made friendly comments toward Israelis. But Ahmadinejad relented and dropped Mashai.

Khamenei also took an apparent jab Monday at opposition leader Mousavi and others who have claimed the election was marred by abuses.

"This election was a test. People passed the test ... and some of the elites failed. This election made some (figures) the losers," state TV quoted Khamenei as saying.

But even conservatives have turned against the leadership over the elections and the harsh crackdowns that have followed. On Sunday, Ahmadinejad's main conservative election challenger, Mohsen Rezaei, demanded that authorities hold trials for those accusing of killing protesters.

More than 100 people, including many prominent reformist political figures, are facing trial for allegedly supporting the postelection unrest.

There was no word from Iranian authorities on three Americans detained after reportedly wandering across the border with Iraq last week during a hike in the Iraqi Kurdish region.

The Swiss Embassy in Tehran is trying to learn more about the Americans' fate through its contacts with the Iranian Foreign Ministry, spokeswoman Nadine Olivieri said Sunday. Switzerland represents U.S. interests in Iran in the absence of American-Iranian diplomatic relations.

The three Americans were detained by Iranian border guards, the Kurdish regional government said. One American who was traveling with the group, Shon Meckfessel, sat out the hike because he had a cold, said his grandmother, Irene Meckfessel, from her home in Carmichael, California.

One of the missing Americans has been identified by Kurdish authorities as Joshua Fattal. His mother, Laura Fattal of Elkins Park, Pennsylvania, issued a brief statement Sunday saying her only concern was for the welfare of her son and his two traveling companions.