SAN JUAN, Puerto Rico (AP) — Puerto Rico’s Supreme Court ruled Wednesday that the votes cast during a botched primary over the weekend are valid and that a second round of voting will be held this Sunday at centers that never opened or did not remain open for the required eight hours.

The ruling was a response to five lawsuits filed after missing or delayed ballots meant that voting occurred in only about 60 of Puerto Rico’s 110 precincts last Sunday.

“Let’s hope that, in the name of democracy, there are no more failures, inefficiencies, errors or delays. Any other result or deviation from what is stated here would be clearly unacceptable,” the court stated.

Three of the five lawsuits were filed by gubernatorial nominees who demanded that the votes already cast be tallied and made public. A fourth suit by Gov. Wanda Vázquez, who competed in her party’s primary, asked that a second round of voting be held at all voting centers that opened late. The fifth lawsuit was filed by a female voter represented by the American Civil Liberties Union.

The decision was celebrated by voters, including Andrés Pérez, a retiree who stood in line for nine hours before going home after being told that his voting center would not open.

“They did a good job,” he said of the Supreme Court justices. “It’s what’s easiest and least problematic.”

Pérez said he would show up at the same voting center at 6 a.m. Sunday to cast his ballot.

Maite Oronoz, president of Puerto Rico’s Supreme Court, said in her opinion that there was no perfect solution to what she called an “embarrassment” that lacerated “beyond repair” the fundamental right to vote.

“Thousands of Puerto Ricans invested their time, risked their lives in the face of potential contagion of COVID-19, made arrangements at their jobs or homes, waited in lines under the sun, paid for transportation or mobilized on foot — more than once — to exercise their right to vote. Many even served as volunteers in the schools to guarantee the purity of the processes and the State Elections Commission failed them abysmally,” she wrote.

Electoral officials acknowledged after the voting debacle that the last remaining ballots didn’t arrive until Saturday night and that rental trucks carrying ballots and electronic voting machines didn’t go out until early Sunday, the day of the primary. The materials usually are delivered one or two days ahead of time.

Vázquez and the presidents of the island’s two main parties have demanded the resignation of the elections commission president, Juan Ernesto Dávila.

Dávila has said it would be irresponsible to do resign while the primaries are still unresolved and told The Associated Press that he does not believe it was a mistake to hold the primaries despite knowing things were running behind schedule. He blamed the delays on the pandemic, Tropical Storm Isaias and a last minute request from both parties for additional ballots.

“I want to urge the People of Puerto Rico to have confidence in our electoral system,” Dávila said in a statement shortly after the ruling. “We will evaluate and adopt the corresponding measures to ensure that the voting process is orderly and that the expectations of the voters who participate in this process are honored.”

A federal control board overseeing Puerto Rico’s finances has authorized $1.27 million for the second round of votes, warning in a letter that “the efficiency in the use of these funds is paramount.”

Vázquez is competing against Pedro Pierluisi, a former justice secretary who represented Puerto Rico in Congress for eight years, for the gubernatorial nomination of the pro-statehood New Progressive Party. Pierluisi briefly served as governor last year after Gov. Ricardo Rosselló quit following huge protests over corruption and a profanity-laced chat that was leaked. But the island’s Supreme Court ruled Vázquez was constitutionally next in line as justice secretary since there was no secretary of state at the time.

The main opposition Popular Democratic Party has three nominees: San Juan Mayor Carmen Yulín Cruz, known for her public spats with U.S. President Donald Trump following Hurricane Maria; Puerto Rico Sen. Eduardo Bhatia; and Carlos Delgado, mayor of the northwest town of Isabela.

Bhatia said he respected the decision of the Supreme Court and like others urged people to go out again and vote.

“Don’t let anyone make you think that the decision has already been made,” he said. “Don’t let anyone make you think that your vote doesn’t count.”

Read More