US Secretary of State Mike Pompeo made an unannounced visit to Kabul on Monday for talks with Afghan leaders, an Afghan official said, amid renewed optimism for peace in the war-weary country.

The official confirmed Pompeo's arrival in the capital Kabul, his first trip to Afghanistan since he was sworn in as America's top diplomat in April, on the condition of anonymity. A joint press conference with President Ashraf Ghani is due to start shortly.

The visit follows an unprecedented ceasefire during Eid last month when the holiday was marked by spontaneous street celebrations involving Afghan security forces and Taliban militants.

Fighters on both sides have expressed a deep fatigue with the grinding conflict, raising hopes that an end to hostilities was possible after 17 years of war that began with the US-led invasion in 2001 that ousted the Taliban from power.

But the insurgents refused the government's request to extend their three-day ceasefire, launching attacks that have seen scores killed or injured.

A security official told AFP that the number of Taliban attacks across the country had fallen since the ceasefire, but the claim could not be verified.

US-backed Ghani, who is under international pressure to ensure credible parliamentary elections are held in October ahead of next year's presidential vote, has been leading the push for peace talks.

The Taliban have so far ignored Ghani's offer of negotiations. Instead, they have insisted on direct talks with the United States, which Washington has repeatedly refused.

One of the Taliban's key demands for engaging in talks has been the complete withdrawal of foreign troops from Afghanistan, but observers say they now appear amenable to a timetable for their pullout.

Currently, there are about 14,000 US troops in Afghanistan, providing the main component of the NATO mission there to support and train local forces.

Growing pressure

A foreign official told reporters in Kabul recently that there was an increasing debate within the Taliban leadership over how to respond to growing pressure to take part in negotiations.

But the renewed violence and the Taliban's recent vow to continue their bloody fight against the government and their foreign backers has dampened optimism that the truce would provide a clear path to peace talks.

Pompeo's visit to Kabul comes almost a year since US President Donald Trump announced his much-vaunted South Asia strategy to tackle Afghanistan by including a broader regional approach.

The aim is to convince the Taliban through diplomatic, military and social pressure that it cannot win and must reconcile.

US envoy Alice Wells told reporters in Kabul on June 30 that the Taliban's inertia on negotiations was “unacceptable”.

Wells, the principal deputy assistant secretary for the State Department's Bureau of South and Central Asian Affairs, said that since the Afghan government and the United States were willing to start talking without preconditions, the onus was now on the Taliban to respond.

International Islamic scholars meeting in Saudi Arabia this week are expected to add their weight to stopping the Afghan conflict.

That comes on the heels of a fatwa issued by Afghanistan's top clerics branding suicide attacks “haram”, or forbidden.

Pompeo is on a round-the-world diplomatic mission that will take him to Brussels and a key NATO summit on July 11-12.