Pakistan and Afghanistan have agreed to an “immediate ceasefire” following crisis talks mediated by Qatar and Turkey in Doha, the Qatari Foreign Ministry said in a statement late Saturday.

According to the statement, both sides also agreed to establish joint mechanisms aimed at ensuring lasting peace and stability along their shared border.

Pakistan’s Defense Minister Khawaja Asif confirmed the ceasefire in a post on X, saying that the two sides would hold follow-up talks in Istanbul on October 25.

“Terrorism on Pakistani soil conducted from Afghanistan will immediately stop. Both neighboring countries will respect each other’s sovereignty,” Asif said.

The agreement comes after several days of intense cross-border fighting last week that left dozens dead and hundreds wounded on both sides.

The two countries had earlier reached a temporary 48-hour truce on Wednesday evening — their first since the Taliban’s takeover of Afghanistan in 2021 — following the deadliest week of clashes in recent years.

That short-term ceasefire expired Friday evening without a formal extension, though diplomatic efforts to prevent further escalation were ongoing.

Afghan officials, however, accused Pakistan’s military of launching strikes in an eastern Afghan province just hours after the earlier truce ended.

Qatar’s Foreign Ministry said both nations had shown a willingness to pursue dialogue and pledged to continue mediating to help achieve long-term peace and de-escalation in the region.