LIMA, Peru — On July 28, 1821, a rapt crowd packed a Lima plaza to hear liberator José de San Martín declare that Peru was free from colonial power Spain. On Tuesday, the 199th anniversary of independence, there were no crowds because of the pandemic, but plenty of somber warnings that Peru faces some of the biggest challenges in its modern history.

Flanked by security guards on foot, a car slowly ferried President Martín Vizcarra, wearing a mask and red-and-white ceremonial sash, through nearly empty streets to Peru's congress building. There, he tried in a televised speech to galvanize a country battered, like so many others around the world, by economic calamity and mass death from the new coronavirus.

"We must be clear that Peru has always moved forward, and this time won't be any different," said Vizcarra, who was a political novice when he became president in 2018. But he acknowledged that the coronavirus has brought Peru a "crisis greater than those we have faced in the past."

Peru, whose population of 33 million is scattered from the Pacific coast to the Andes to the Amazon, is accustomed to crises.

In a test of democratic structures last year, Vizcarra dissolved the opposition-controlled congress, which had objected to his plans for anti-corruption reforms. The top court backed the president.

The Latin American country also remains haunted by the brutal insurgency of Maoist Shining Path guerrillas. A truth commission found that between 1980 and 2000, fighting among rebel groups, the government and self-defense patrols killed up to 70,000 people.

Peru has reported about 18,500 deaths from COVID-19 and 390,000 confirmed cases of the coronavirus, making it one of the world's hardest hit countries. The actual numbers are likely much higher. The pandemic exposed weaknesses in Peru's poorly funded health system.

A strict lockdown imposed by the government March 16 drained an economy whose growth in the decade after the end of armed conflict had reduced poverty. The economy was down 32.75% in May from the same month in 2019, though that was an improvement on the 40.5% drop in April as Peru slowly reopens the economy, according to INEI, the state statistics agency.

In his speech, which lasted nearly two hours, Vizcarra said the strict lockdown, which included arrests and fines for violating social distancing regulations, had averted a death toll in the hundreds of thousands. He promised more spending on health resources and said his administration had implemented robust subsidies for people struggling economically even before the onslaught of the virus.

"Peruvians know I'm one of the few presidents who has reported daily about actions, data, results and all the details," said Vizcarra, an engineer by training whose most significant political experience had been four years as governor of a sparsely populated region in southern Peru.

Many of his presidential predecessors have been discredited by corruption allegations, deepening skepticism of Peruvians toward the pronouncements of their leaders.

The public defender's office said in a July report that Peru was a "vulnerable country" even before the pandemic. It said numerous social conflicts, some involving Indigenous groups and the expansion of the mining industry into community land, would likely emerge again as the country slowly reopens.

The office also warned that elections scheduled for April 11 could be compromised by the pandemic. "The electoral calendar will unfold partly or totally in conditions of contagion risk or amid the effects of the pandemic," its report said.

So, despite Vizcarra's meticulous, data-heavy speech, more uncertainty and hardship await in Peru. That was also Peru's future 199 years ago, when San Martín declared independence and, according to historical accounts, bells tolled, artillery boomed in salute and crowds spilled into side streets.

The fight for independence went on for years after that euphoric day.