Tadamichi Yamamoto told the Security Council that the events of recent days and weeks "have shown, more than ever, the urgency of finding a political settlement to the long Afghan conflict."
The U.N. envoy said opportunities for peace over the past year "created hope, but also fear for many," and made clear that the conflict can only be resolved by direct talks involving "the whole spectrum of Afghan society."
He urged the parties to the conflict and all those interested in peace to keep working to bring about direct talks.
Recent informal talks between the Taliban and representatives of Afghan society in Doha and Moscow addressed some key issues for peace, Yamamoto said. He expressed hope this would be carried forward and deepened.
Peace efforts must address and lead to a reduction in violence and an eventual cease-fire, he said.
But, Yamamoto added, "any political settlement must include a promise to continue to protect and advance human rights and fundamental freedoms for all who live in Afghanistan, including those of women, youth and minorities as well as the freedom of expression and the media."
Yamamoto said security, voter turnout and fraud are major challenges for the presidential election.
While the Afghan government's technical and operational preparations for the elections are on track, he said, "we still hear much anxiety expressed by Afghan citizens particularly in view of the Taliban's stated threat to disrupt the electoral process, especially by targeting civilians participating in the elections."
Stressing that attacks on voters and polling stations are "clear violations of international law," Yamamoto urged the Taliban to withdraw its threat. And he urged the government to provide adequate security to safeguard the electoral process.
Yamamoto said 9.6 million people have registered to vote, but turnout could be affected by security worries.
"Credible elections would provide an important political foundation for the future of the country as well as legitimacy and authority to the elected president, which would be particularly important in view of the expected peace process," he said.
Afghanistan's U.N. ambassador, Adela Raz, said that despite security threats and challenges, the Afghan people "are determined to hold and participate in the elections."
Raz, the country's first female ambassador, urged the Security Council to call on countries with influence on the Taliban "to respect the aspiration of every Afghan, and prevent them from attacks on the election day."
She said the government remains committed to peace talks, stressing that any agreement must be endorsed by the Afghan people and ensure an immediate cease-fire and the preservation of the gains and achievements of the past 18 years.
Raz singled out Afghanistan's "democratic values, the republic, and in particular, the rights of women as stipulated in our constitution."