Iran's supreme leader formally endorsed Mahmoud Ahmadinejad for 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 received an awkward kiss on the shoulder from Ahmadinejad. It 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. The ceremony with Khamenei showed 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. 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. Ahmadinejad - who kissed Khamenei's hand four years ago to show absolute loyalty - had a more tentative exchange this time. He appeared to approach Khamenei to kiss his hand, but the leader stopped him and took a step back. The two exchanged words, Ahmadinejad smiled, and then Khamenei allowed him to kiss his shoulder - not a common gesture in Iran, where men often exchange kisses on the cheeks. It appeared Khamenei sought to show a close bond with Ahmadinejad without the elaborate display of kissing his hand. Iran faces some important tests in the early months of Ahmadinejad's second, four-year term. US 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, US 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 Teheran's nuclear program - which some fear could lead to atomic weapons. Iran insists it seeks only energy-producing reactors. 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 and others opposed by Khamenei. 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.