Pakistan and Afghanistan announced a temporary pause in escalating fighting ahead of Eid al-Fitr, two days after a deadly airstrike that Kabul blamed on Pakistan struck a drug rehabilitation hospital in Kabul. Pakistan said the suspension of strikes on Afghanistan would take effect at midnight Wednesday and remain in place until midnight Monday, framing it as a gesture tied to Islamic norms. Afghanistan’s government spokesman Zabiullah Mujahid did not lay out a matching time frame, but said the country would respond “courageously” to any aggression if a threat emerged.

The announcements came shortly after Afghan authorities held a mass funeral in Kabul for victims of Monday’s strike. Bulldozers dug pits in the cemetery before the service, and ambulances lined up outside as crews unloaded dozens of plain wooden caskets. Health Ministry spokesman Sharafat Zaman said the funeral was for more than 50 people whose remains could not be identified, with some caskets containing the remains of more than one person.

Pakistan and Afghanistan said they were suspending fighting before Eid al-Fitr, which marks the end of Ramadan, and they linked the decision to mediation efforts by Saudi Arabia, Turkey and Qatar. The three countries had been trying to mediate a cessation of hostilities as fighting resumed between the two neighbors in February, after a period that included their involvement in helping broker a ceasefire in October.

Pakistan’s Information Minister Attaullah Tarar said in a statement that Pakistan was offering the gesture “in good faith and in keeping with the Islamic norms.” He added a condition that would allow a return to hostilities if violence resumed, saying Pakistan would immediately resume operations with “renewed intensity” in case of any cross-border attack, drone attack or any “terrorist incident inside Pakistan.” In an Associated Press interview earlier Wednesday in Islamabad, Tarar also said Pakistan had “only targeted terrorist infrastructure,” describing its strikes as “very precise,” and saying the Monday attack stemmed from an ammunition depot in Kabul.

Afghan officials meanwhile condemned the Monday strike, accusing Pakistan of “targeting hospitals and civilian sites to perpetrate horrors.” Mujahid said the people killed were “innocent civilians and addicts.” Afghan officials put the death toll at 408 people, including 265 wounded, though the toll was described as not being independently verified.

Pakistan rejected those assertions, saying it did not target the Omid Addiction Treatment Hospital. Pakistan said its Monday and earlier strikes were against military facilities and dismissed Afghan claims of hundreds killed as propaganda. The conflict has included repeated cross-border clashes and airstrikes inside Afghanistan, including in the capital, despite international calls for a ceasefire.

The Omid Addiction Treatment Hospital, a 2,000-bed facility near Kabul’s international airport, was hit at around 9 p.m. on Monday. Afghan reporting said it had been renamed and expanded roughly a year ago from a previously existing treatment facility as part of the Taliban government’s efforts to address what officials described as a significant drug addiction problem. The strike led to an intense fire at the hospital, and local television footage showed rescue crews combing through wreckage with flashlights late into the night as firefighters worked to extinguish the blaze.

Tarar warned Afghanistan that it faced a choice, telling the AP that Pakistan had given the Afghan government a binary decision between being “with Pakistan” or “with the terrorists,” and saying Afghanistan would need to make that choice “very soon.” Mujahid’s response emphasized that Afghanistan would act against threats, while the pause announced by both sides is set against the backdrop of a conflict that international observers have said has alarmed the international community because other militant groups, including al-Qaida and Islamic State, still have presence in the region.

The latest fighting began in February after Afghanistan launched cross-border attacks in response to Pakistani airstrikes about three weeks earlier. Officials said the clashes disrupted a ceasefire brokered by Qatar in October, after earlier fighting in late February and before it included killings of soldiers, civilians and suspected militants. Pakistan declared last month that it was in “open war” with Afghanistan, as the conflict escalated following the airstrike accusations that Afghan officials say killed hundreds at the hospital in Kabul.