CARACAS — With leaders from five continents on hand, Venezuela had a day of distinctly different ceremonies — first the formal state funeral of Hugo Chavez, then the controversial swearing in of his anointed interim successor, who the opposition charges has no constitutional right to the job. Friday's funeral at the military academy where Chavez was lying in state promised to be a final turn on the world stage for the former paratrooper after 14 tumultuous years at Venezuela's helm, though in some ways he was not going anywhere: Venezuela announced Thursday that it would embalm Chavez's body and put it on permanent display. Hours before the visiting dignitaries arrived, Venezuelans in their hundreds of thousands filed past Chavez's glass-covered casket in a round-the-clock marathon of tears, prayers and military salutes. The last of what the Venezuelan government says are more than 30 heads of state arrived for the funeral early Friday. Iranian President Mahmoud Ahmadinejad touched down after 1 a.m. and Chilean President Sebastian Pinera landed around dawn. “It is a great pain for us because we have lost a friend,” Ahmadinejad said upon his arrival. “I feel like I have lost myself, but I am sure that he still lives. Chavez will never die. His spirit and soul live on in each of our hearts.” US Rep. Gregory Meeks, a New York Democrat, and former Rep. William Delahunt, a Democrat from Massachusetts, represented the United States, which Chavez often portrayed as a great global evil even as he sent the country billions of dollars in oil each year. The normally traffic-choked streets of Caracas were empty, with schools and many businesses shuttered. The government also prohibited alcohol sales. Many Venezuelans, particularly Chavez supporters, said they were caught up in the pomp and circumstance of the past few days, and flattered to be in the world's attention. “This is historic ...I have never seen anything like it,” said Edila Ojeda, a 57-year-old janitor. “He was a world leader recognized internationally. I am speechless. It is impressive.” Others said they were put off by what they saw as excess, particularly the plan to put Chavez's body on permanent display. “He was a president, and I would say not a good one. Not a hero,” said Gloria Ocampos, a retired office manager. “He should be buried, just like any other president. They are treating him like he was the father of the country ... It's crazy.” Following the funeral, National Assembly Speaker Diosdado Cabello swore in Vice President Nicolas Maduro as interim president, as Chavez desired, despite complaints by the opposition that Cabello is the rightful holder of that post under the constitution. The constitution says elections must be held within 30 days of Chavez's Mar. 5 death, though the government has not set a date. Maduro has announced he will be the candidate of Chavez's ruling socialist party against likely opposition candidate Henrique Capriles, and many expect him to ride the wave of emotion following Chavez's death to victory. Friday's funeral was a climax to three days of ceremony following Chavez's death, and Venezuelan media were filled with commentary about the outsized place the late leader held on the world stage. Jaua said countries from Cuba to China to Iran had declared days of national mourning for Chavez, highly unusual for the leader of another country. Chavez was particularly beloved by the poor, whose lot he championed. But critics say he left his successors a monumental task, with inflation of more than 20 percent a year, and public debt quadrupling to more than $100 billion. Crime is endemic and Chavez's chaotic management style has been blamed for a breakdown in infrastructure, particularly in the key oil industry. — AP