SANTIAGO, Chile — Chileans voted overwhelmingly Sunday to rewrite the country’s constitution, which dates from the military dictatorship of Gen. Augusto Pinochet four decades ago.

With 99% of ballots counted, 78% of voters favored drafting a new national charter, while 22% rejected the initiative, according to official results.

The margin of victory exceeded projections in polls that about 70% of Chileans would favor a rewrite of the 1980 constitution.

The constitutional vote — a reaction to last year’s civil unrest that paralyzed this South American nation of 19 million — became a kind of referendum on the country’s future. Critics said a new constitution was needed to reform deep economic and social inequalities, while supporters of the current constitution feared changing it could lead to instability.

President Sebastián Piñera, who had maintained a publicly neutral stance on the issue, confirmed that the move to draft a new constitution had triumphed. “Today, unity has prevailed over division,” Piñera said in an evening address to the nation. “And peace over violence. This is a triumph for all Chileans who love democracy, unity and peace.”

Thousands of Chileans gathered Sunday night in Plaza Baquedano to celebrate the vote. Fireworks marking the balloting illuminated the capital’s skyline.

Chile’s referendum, originally scheduled for April but pushed back because of the COVID-19 pandemic, was the government’s major concession to the mass protests.

Chileans also voted for the new constitution to be drawn up by a 155-member assembly to be elected in April. Voters rejected an alternative that would have seen a mix of current lawmakers and elected citizens rewriting the constitution. The decision would appear to reflect a lack of faith in the country’s current elected leadership.

“I want a new constitution, and I want new people to draft it because trust in politicians is over,” said María José Ugarte, 30, a yoga instructor lining up to vote at Santiago’s National Stadium.

The stadium had been used as a prison camp after the 1973 military coup led by Pinochet that overthrew the democratically elected government of leftist President Salvador Allende.

“I know changes won’t happen right away, but we need radical change,” Ugarte said.

Once a new constitution is drafted — after up to a year of work — the document would be submitted to voters in yet another referendum scheduled for 2022.

Chile’s current constitution enshrines the free- market principles endorsed by the former military leadership.

“I hope that a new constitution guarantees health, education and housing as human rights,” Jorge Molina, 86, a retired engineer, said after voting at a school near downtown Santiago.

Molina said he receives a pension of $750 a month but spends more than half of it on medical bills — he has diabetes, prostate problems and glaucoma. His life savings, he said, were drained by treatments for the cancer that afflicted his wife before her death.

“I receive a relatively high pension for Chile and look how I am,” he said. “Imagine how the rest of the old folks do here.”

Opponents worried that constitutional reforms could dampen prospects for growth and heighten pressure on state finances already stretched thin by the pandemic.

“It’s true that there are many inequalities here, but there have to be better ways to handle the problem,” Fernando Cabello, 45, son of one of the thousands of Chileans exiled during the dictatorship, said after voting against the constitutional change at a school in the capital’s Providencia neighborhood.

“I grew up in Venezuela, so I witnessed the Chavista revolution,” he said, referring to the leftist government of former President Hugo Chávez of Venezuela. “I’m totally against that way of making changes.”

Sunday’s referendum took place 32 years after Chileans went to the polls in a landmark plebiscite and voted to end the dictatorial rule of Pinochet. The 1988 plebiscite led to Pinochet stepping down in 1990.

During the 17-year junta, Chile became known as a leader of the free-market philosophy widely referred to in Latin America as neoliberalism. Leftist governments in Mexico and elsewhere in the region have denounced neoliberalism as a strategy that heightened inequality and spread poverty throughout Latin America.

“We never thought there could be a new constitution,” Fabiola Campillay, 37, told local media who were waiting for her outside her home in the working-class neighborhood of San Bernardo, south of Santiago, on Sunday afternoon.

Last November, Campillay lost sight in both eyes, as well as her sense of taste and smell, when a tear gas canister fired by police hit her face. At the time, she was waiting for a bus to take her to the spaghetti factory where she worked.

The officer who fired the tear gas shell was dismissed and is in prison, while Campillay, a supporter of the constitutional change, became a symbol of last year’s protests.

According to Chile’s National Human Rights Institute, almost 4,000 civilians were injured in the protests and clashes with police, including 460 who suffered eye injuries.

“Now we have to keep fighting,” Campillay said Sunday. “We have to keep fighting so that the constitution is written by the people and not by the same politicians as always.”

Special correspondent Poblete reported from Santiago and Times staff writer McDonnell reported from Mexico City.