KABUL — With the tense Afghan presidential election only days away amid threats of Taliban violence, a wave of criticism has erupted over government efforts to protect voters from harm, with complaints that some polling centers are being left open in dangerous areas and that others are being closed for political reasons or will be vulnerable to fraud.

The independent election commission announced last month that about 2,000 of 7,366 potential polling centers nationwide — most of them schools — would be closed because security forces could not guarantee their safety. Last week, officials announced that 431 more centers would be closed for the same reason.

Government opponents, however, charge that some of the new closures — which will bring the number of shuttered centers to about 31 percent of the total — are the result of political manipulation to favor President Ashraf Ghani, who is running for reelection, rather than bona fide security concerns.

Saturday’s election, which comes just weeks after the collapse of U.S.-Taliban peace talks, will essentially be a rematch between Ghani and his major challenger, Abdullah Abdullah, who is now the government’s chief executive, although 15 other candidates are officially running.

Supporters of Abdullah and others charge that some centers are belatedly being closed to benefit Ghani. They point out that most are in northern provinces that are considered relatively safe or are more likely to vote for Abdullah, based on past ethnic and political loyalties.

“This has been planned carefully. They have made certain areas insecure so they can stuff ballot boxes,” said Mohammed Nateqi, an adviser to Abdullah. In 2014, Abdullah also ran against Ghani in a bitter, inconclusive contest that ended with the Obama administration persuading the two men to form a power-sharing pact.

Abdullah has charged that Ghani, who seeks to win a second five-year term and spearhead domestic peace talks with the Taliban, is using official powers and funds to buy support and possibly rig the polls. Last month, 13 previous election officials were sent to prison for graft, and public mistrust of the newly staffed election apparatus remains high. 

Ghani and his aides have brushed off charges of trying to fix the election, and most observers expect him to win outright with more than half the ballots. But the polling center complaints have acquired sudden importance because Ghani and his government, closely allied with Washington and heavily dependent on U.S. support, have come under unexpectedly sharp criticism from the Trump administration. 

This development is widely seen here as giving a last-minute boost to Abdullah’s chances. He has abruptly stepped up his campaign schedule after a slow start. With both a close vote and low turnout predicted, the closures could make a significant difference.

American preference, either explicit or inferred, is considered a key factor in Afghan elections. The United States has spent more than $800 billion helping to rebuild Afghanistan since 2001 and has sent more than 100,000 troops to defend it. Ghani was long viewed in Washington as a high-minded technocrat and a modernizing force for the struggling country.

But Secretary of State Mike Pompeo, in a sharply worded statement Thursday, said the administration would cut $100 million in funding for an Afghan energy project because of government corruption and mismanagement. He also criticized two of Ghani’s high-priority programs to monitor public spending and contracting, saying they had not been “transparent” or accountable.

“We expect the Afghan government to demonstrate a clear commitment to fight corruption, to serve the Afghan people and to maintain their trust,” he said. “Afghan leaders who fail to meet this standard should be held accountable.”

Pompeo also said the U.S. administration has “called repeatedly” for the Afghan government and electoral institutions to prepare a “credible and transparent presidential election. . . . We hold all candidates accountable to the code of conduct they signed.”

Some analysts said these ­comments reflect U.S. officials’ pique at Ghani’s anger and foot-dragging after being sidelined from the U.S.-Taliban talks, not just concern over corruption or election fraud. There has been no sign that Washington would view Abdullah as a preferable choice, although the polished former foreign minister is a familiar figure to U.S. officials. 

Nevertheless, the timing and tone of the criticism have come as a shock here and intensified domestic concerns that Ghani may resort to desperate measures to win. The poll closures, which election officials say are meant to protect voters from violence, are now seen by some as denying them the right to vote.

“The government has engaged in a lot of wrongdoing, including about the polling stations,” said Ahmad Wali Massood, a presidential candidate. “In places that are secure, they are closing the stations because they know Dr. Ghani will not get votes, and in some insecure places where he has support, they are leaving them open. The whole thing is upside down.”

Officials have said they plan to deploy more than 70,000 security personnel to protect the open polls, but they never publicly released the locations of the 2,000 centers that were initially closed. Most were assumed to be in rural areas under Taliban threat or control, largely in the south and southeast. 

In interviews earlier this month, officials from several ­Taliban-plagued provinces described a mixed picture of voting conditions. In the southeastern province of Ghazni, which has faced longtime Taliban threats, officials said some districts would be safe for voters; some were too dangerous to open any polling centers; and in others that were relatively secure, centers had been closed for political reasons. 

“The Taliban can wage terror here. Our main city is under siege, and they control about half of the districts. People will be scared,” said Arif Rahmani, a member of parliament from Ghazni. But he also said that in some peaceful districts dominated by ethnic minority Hazaras, “the government knows Ghani will not get the votes, so they have deliberately closed polling stations.”

A spokesman for the Ministry of Defense, Fawad Aman, said the security and closure plans were still changing day by day. In Ghazni, he said, some districts had recently been recaptured by security forces, but because they had been in Taliban hands during voter registration, no polls could open. 

When the government announced the 431 new closures, it listed them by province. To widespread public surprise, some with the most shuttered locations were in relatively safe or pro-Abdullah areas. Balkh, a northern province with few Taliban problems that strongly backed Abdullah in 2014, had the highest number, with 89 centers to be closed. Ghowr, a remote central province, was second with 66 closures.

Yousuf Rasheed, director of the Free and Fair Election Forum of Afghanistan, said that fear of insurgent attacks remains the greatest concern for voters but that the difficulty of recruiting poll-watchers and transporting election materials “will create opportunities for fraud and make it hard to challenge the validity of ballots.” This time, he said, “the stakes are higher, but the scrutiny will be lower.”

In Farah, a far western province that has been besieged by Taliban attacks, officials said the insurgents now control more areas than they did a year ago, when only a fraction of 600,000 registered voters cast ballots for members of parliament. Many polling stations will likely be shut, including 11 whose closures were announced last week.

“The Taliban are everywhere. Even in the capital they force teachers and government workers to pay them taxes,” said Belquis Roshan, a legislator from Farah. “It is even worse in rural areas. There is no sign of election activity at all. This time, I doubt even 10,000 people will vote.” 

Sayed Salahuddin and Sharif Hassan contributed to this report.