ISLAMABAD, Pakistan — An important upcoming milestone for Afghanistan’s Western-backed democracy and a separate, crucial chance to settle the country’s 17-year war appear to be crashing into each other.

The country’s presidential election, planned for April 20, is already roiling the political atmosphere. As President Ashraf Ghani, who is seeking a second term, and an array of potential rivals try to form winning coalitions, observers fear the race could divide the country along dangerous ethnic lines. 

At the same time, momentum for talks with the Taliban is steadily building, with a special U.S. peace envoy pushing the process hard and insurgent leaders showing serious interest in negotiating for the first time. But they have insisted that they will not deal directly with the Ghani government, instead reportedly meeting U.S. officials in Qatar and then attending a recent pro-peace conference in Moscow.

As both developments accelerate, some Afghan and Western voices have begun questioning whether the peace process may need to come first, rather than competing on a parallel track that could enmesh the election run-up in battles over the cost of peace and sabotage the first steps toward reconciliation.

“The constitution is not as important as peace. If peace can be restored, then the elections will have to be delayed for it,” Wadir Safi, a professor of political science at Kabul University, told the Weesa Daily newspaper here.

On the other hand, other Afghans are concerned that the Trump administration, in its haste to speed up talks and end the long and costly war, could push for concessions that might weaken or undo the Democratic gains of the post-Taliban era.

Press reports this week that the Trump administration is considering asking the Ghani government to delay the election and prioritize the peace process could not be confirmed. There were also unconfirmed reports that the U.S. peace envoy, Zalmay Khalilzad, had broached the same idea in private talks with Taliban representatives.

On Tuesday, the U.S. ambassador in Kabul, John R. Bass, said in an online post and tweet: “We remain committed to helping the electoral commissions and the Afghan government prepare for presidential elections in April 2019. Timing of Afghan elections is for Afghans to decide.”

The Ghani government has insisted that the polls will take place on time, in accordance with the Afghan constitution. It has rejected a variety of alternative proposals from Afghan political groups, such as holding a national assembly of elders or creating an interim government while the peace process continues.

Ghani has also offered repeatedly to talk with the Taliban, but after a brief truce in June, the insurgents returned to an aggressive military campaign and sought other foreign interlocutors. Last week at the meeting in Moscow, Taliban representatives denounced Ghani and his government, which sent only inexperienced peace commission members who said little.

“This was a big win for Russian diplomacy and Taliban public relations, and a big loss for the Afghan government,” said Kabul analyst Harris Wadan. Shortly after the meeting, the insurgents launched attacks in previously safe areas of Ghazni province, sending hundreds of people fleeing to other regions.

The political effect of these diplomatic and battlefield maneuvers has been to weaken the Ghani government’s credibility and incumbent advantage. This could potentially turn the race into a nasty free-for-all, with powerful former warlords either running or playing kingmakers, while Taliban leaders keep stretching out the peace process and prosecuting the war.

“The Taliban have refused to talk to Ghani and his government because they do not consider it legitimate,” said Haroun Mir, an analyst in Kabul. Whether the president is reelected or replaced, the results will probably be marred by charges of fraud, Mir added, giving the next government “a tainted legitimacy” and further strengthening the Taliban’s position in negotiating with the United States.

The outcome of the election will “tremendously impact the peace talks,” Mir said. If the Afghan elite remains fragmented and cannot build a united front against the insurgents, they will make few major concessions in talks. “At this stage, we need a leader who is able to bring people together rather than deepening political and ethnic rifts,” he said.

Younus Qanooni, a senior figure in the main ethnic Tajik opposition group, warned that the election presents a “very dangerous challenge” that could “divide the country” between the Pashtun south and the ethnic-minority-led north. He said this risk was “far greater” than in the 2014 presidential election, which was so badly flawed that the United States had to broker a power-sharing arrangement between Ghani and his top rival.

The Taliban, whose members are Pashtun, has listed several demands for potential peace talks that would be very difficult for many Afghans to accept, such as implementing full Islamic law, keeping control of southern provinces and changing the constitution. 

Despite the public’s sense of urgency about ending the war, many Afghans fear the price of peace will be too high. The insurgents have separate demands for U.S. officials, especially that all foreign forces withdraw and foreign military bases be closed.

Salahuddin reported from Kabul.