SAN SALVADOR (Reuters) -El Salvador's President Nayib Bukele took office on Saturday for a second term pledging to cure the "illnesses" of the Central American country by prescribing his medicine to fix the economy, following his successful treatment to cure the "cancer of the gangs" during his first five years in office.

The 42-year-old former nightclub manager was reelected in a landslide victory with more than 80% of the vote in February, following a court decision that paved the way for his re-election even though the country's constitution prohibits it.

"Salvadorean society is still sick but it no longer has cancer," Bukele told the crowd from the balcony of the National Palace in the capital San Salvador. The cancer referred to criminal gangs that once made the country one of the world's deadliest to live in, but have been brought under control through mass arrests during his leadership.

"Now that we have fixed the most urgent thing, which was security, we are going to focus on the important problems, starting with the economy," said the president who faces fresh challenges to rejuvenate a stagnant economy and tackle poverty. Bukele added that his "prescription is working."

Saturday's swearing in ceremony took place amid security concerns after police said they had thwarted a bomb threat.

Seven people were arrested for plotting to detonate explosives at locations across the country, police said on Thursday, adding that the suspects were part of the so-called Salvadoran Insurrection Brigade.

Among the attendees at the ceremony was Argentina's libertarian President Javier Milei and Donald Trump Jr, the son of former U.S. President Donald Trump, who arrived in El Salvador on Friday. His father earlier this week became the first former U.S. president to be convicted of a felony.

Bukele, who is of Palestinian descent, won re-election in February after garnering massive popularity in his first term for transforming security in the country of 6.3 million people that was once one of the world's most dangerous.

Authorities under his watch have suspended civil liberties to arrest more than 80,000 Salvadorans without charge which has drawn criticism from human rights groups but won him a devoted following domestically and across the region for bringing safety to the streets.

With safer neighborhoods, public concern has now turned to the economy which will likely be Bukele's biggest challenge in his second term. More than a quarter of Salvadorans live in poverty and unemployment is on the rise.

The president's highly publicized plans for Bitcoin City, a tax-free crypto haven powered by geothermal energy from a volcano, have failed to gain momentum and private investment has tumbled. El Salvador's public debt meanwhile has skyrocketed on Bukele's watch to more than $30 billion, or 84% of the country's gross domestic product.

Economists said the government faced a difficult balancing act to reduce national debt without cutting much-needed social benefits to the country's poorest. "They could end up generating a critical situation for women and households in rural areas," economist Julia Evelyn Martínez based in San Salvador said.

(Reporting by Nelson Renteria; Writing by Lucinda Elliott; editing by Diane Craft and Richard Chang)

By Nelson Renteria