Opposition leaders blasted the swearing-in as unconstitutional, just hours after Chavez's official state funeral ceremony ended Friday

Receive the latest national-international updates in your inbox

In this photo released by Miraflores Press Office, Venezuela's Vice President, back to camera, places a sword on the flag-draped casket of Venezuela's late President Hugo Chavez during a funeral ceremony as other Venezuelan officials look on at the military academy in Caracas, Venezuela, Friday, March 8, 2013.

Updated at 4:47 PM PDT on Friday, Mar 8, 2013

Nicolas Maduro, formerly the late Hugo Chavez's vice president, was sworn in as Venezuelan president Friday evening, over the political opposition's protest that the move was unconstitutional.

Maduro was sworn in just hours after he had emotionally eulogized Chavez at a fiery, foot-stomping state funeral on Friday that at times smacked of a political rally as presidents, princes and left-wing glitterati looked on.

Chavez was lauded by his hand-picked successor and a succession of others as a modern-day reincarnation of Latin American liberator Simon Bolivar and a disciple of Cuba's Fidel Castro at the military academy where the funeral was held.

But all was not peace and harmony in a country deeply divided by Chavez's 14 years in power. The opposition coalition announced it would boycott Maduro's swearing-in later Friday, calling it unconstitutional. The dispute foreshadows a bitter presidential campaign to come, with elections mandated within 30 days of Chavez's death.

Opposition leader Henrique Capriles, who received 45 percent of the vote in the October election in which Chavez won his fourth term, accused Maduro of using Chavez's funeral to campaign for the presidency. In his Friday speech, he also said the opposition had asked to attend Chavez's funeral but was told "better that you don't come."

Life and Times of Hugo Chavez

The opposition also rejected the original plan to hold the swearing-in at the military academy, complaining that the armed forces had already virtually endorsed Maduro as Chavez's rightful heir. The government announced at midday that the ceremony had been moved to the National Assembly building.

The country's Supreme Court ruled Friday that Maduro became acting president when Chavez died and could thus run in the election without having to step down. The constitution bars sitting vice presidents from running for the top job. Opposition leader Henrique Capriles, who is expected to challenge Maduro, called the decision a "fraud."

The funeral began with Venezuela's national youth orchestra singing the national anthem, led by famed conductor Gustavo Dudamel. A government-allied congressman later belted out cowboy songs from Chavez's native Barinas state.

The streets outside the military academy took on a carnival atmosphere, with military bands launching into marches and an expanse of supporters wearing the red of Chavez's socialist party. Street vendors sold paper replicas of the presidential sash, which many people in the line slipped over their shoulder.

Throngs watched the ceremony on huge monitors under the blazing sun, while a line to see Chavez's body stretched 1 ½ miles (2 kilometers) but was halted as the funeral got under way.

In the funeral hall, more than 30 political leaders including Cuba's Raul Castro, Spanish Crown Prince Felipe de Borbon, and Iran's Mahmoud Ahmadinejad stood at attention before Chavez's flag-draped coffin, which was closed for the ceremony.

Maduro said that no Venezuelan leader, even Bolivar, who died in exile, faced and overcame such treachery and opposition as Chavez, who succumbed to cancer on Tuesday, at the age of 58

"Here you are, unconquered, pure, transparent, unique, true and always alive," Maduro shouted as many in attendance cried. "Comandante, they couldn't defeat you and they will never, ever defeat us."

Despite the blustery language of his speech and the expulsion on Tuesday of two U.S. military attaches on suspicion of spying, Maduro made a point of welcoming the U.S. delegation led by Rep. Gregory Meeks, a New York Democrat, and former Rep. William Delahunt, a Democrat from Massachusetts. Chavez often railed against America even as he sold the country billions of dollars in oil each year.

State Department officials have voiced hope that Maduro will prove a more pragmatic leader than the often bombastic Chavez, assuming he wins a full term.

Television cameras captured Hollywood star Sean Penn in attendance at the funeral, while the Rev. Jesse Jackson preached rapprochement between his country and Venezuela.

"We pray to God today that you will heal the breach between the U.S. and Venezuela," Jackson said.

But U.S. enemies such as Castro and Ahmadinejad also won loud applause.

"It is a great pain for us because we have lost a friend," Ahmadinejad said upon his arrival at the airport the night before. "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."

Maduro announced Thursday that the government would embalm Chavez's body and put it on permanent display, a decision that touched off strong passions on both sides.

Most of the normally traffic-choked streets of Caracas were empty, with schools and many businesses shuttered. The government also prohibited alcohol sales.

Venezuelans watched the funeral from cafes, with many saying they were flattered to be the subject of the world's attention.

"If my Comandante was such a divisive man who fought with everyone and with other countries, wouldn't he be alone (at his funeral)?" asked Argenis Urbina, a 51-year-old bookseller who was riveted to the coverage on TV.

Others said they were put off by what they saw as an excess of pomp, particularly the plan to put Chavez's body on 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."

Some 300 people also watched the funeral on screens set up in the Simon Bolivar plaza in Chavez's plains hometown of Sabaneta, where people had laid out flowers, candles and photos of the late leader.

Chavez was particularly beloved by the poor, whose lot he championed. But critics say he left his successors a monumental task, with annual inflation of more than 20 percent and public debt that quadrupled 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.

The government gave national and international media no direct access to the funeral, a measure of the strict control with which Chavez and his followers have ruled the country for years. On Thursday, Foreign Minister Elias Jaua appealed to local media not to publish critical political analyses "which could be a provocation for a pained people."

Following the funeral, National Assembly Speaker Diosdado Cabello was to swear in Maduro as interim president, as Chavez desired, despite complaints by the opposition that Cabello is the rightful holder of that post under the constitution.

In announcing the opposition boycott, spokesman Angel Medina said that Maduro's ascension is "a violation of the constitutional order."

"Venezuelans should walk along the path of constitutionality," he said. "Today, more than ever we reject that they use the name of the president of the republic, who today is being buried, for political ends."