Daniel Ortega was sworn in for his third five-year term as president of Nicaragua, shrugging off opposition complaints his re-election was illegal and vowing to govern with moderation.
Mr Ortega took the oath of office in front of about 8,000 people gathered at Revolution Plaza, the site where he and his ragtag band of Sandinista rebels celebrated the overthrow of dictator Anastasio Somoza in 1979.
Presidents from all other Central American nations attended the inauguration, but the most notable visitor was Iranian President Mahmoud Ahmadinejad, who is touring the region to bolster his country's alliances in the US neighbourhood at a moment of sharp disputes with Washington.
Mr Ahmadinejad said both Iran and Nicaragua are "on the road to fight for the establishment of security and justice" and referred to Mr Ortega as "my brother president".
Mr Ortega's closest and most financially supportive ally, Venezuelan president Hugo Chavez, attended the ceremony after playing host to Mr Ahmadinejad in Caracas.
"This is part of a unified process that has been set in motion (in Latin America), because only by being united will we truly be free," Mr Chavez said of Mr Ortega's re-election.
The comment was apparently a reference to the countries in the region which, like Nicaragua, participate in the Chavez-inspired, left-leaning Bolivarian Alliance.
Mr Ortega and Mr Chavez have been staunch defenders of Mr Ahmadinejad, who has come under pressure from US sanctions intended to rein in Tehran's nuclear programme.
In his first comments after taking office, Mr Ortega said that "there is an entire conspiracy against Iran", and suggested Mr Ahmadinejad propose "disarming Israel's nuclear stockpile, in order to bring peace to the region".
Both Mr Ortega and Mr Chavez also defended late Libyan dictator Muammar Gaddafi, who was ousted by a popular uprising aided by Nato airpower and killed in October. Mr Ortega said a "brutal crime" was committed when Gaddafi was killed by rebel captors in October.