Afghan forces have rescued 149 people, including children, who were taken hostage by the Taliban hours earlier on Monday in the Kunduz province, AP reported.

Security forces launched a lightning military operation to rescue the hostages but fighting was still under way to free 21 people, officials said. At least seven Taliban militants have been killed in the encounter.

The deputy spokesperson for the interior ministry, Nasrat Rahimi, said Taliban fighters had ambushed a convoy of three buses travelling on a road in the Khan Abad district.

The Taliban members reportedly asked the passengers to come with them, AP quoted Mohammad Yusouf Ayubi, head of the provincial council in Kunduz, as saying. According to Ayubi, the insurgents could have been looking for government employees or security force personnel who go home for the holidays.

At least 170 passengers were in the buses at the time of the incident, ToloNews quoted a member of the Passenger Bus Union as saying. Safiullah Mahzon, Kunduz security director, said the passengers were taken to Nikpe village. Tribal elders and local officials were trying to negotiate with the militants, AP quoted Ayubi as saying.

Abdul Rahman Aqtash, chief of police chief of neighbouring Takhar, said the passengers were from Badakhshan and Takhar provinces and were travelling to Kabul, reported AP.

The ambush came a day after Afghanistan President Ashraf Ghani declared a “conditional” ceasefire with Taliban militants ahead of the Eid-al-Adha festival this week. The ceasefire, which started on Monday, will be in place for around three months “provided the Taliban reciprocate”, said Ghani.

In June as well, ahead of the Eid-ul-Fitr festival, Ghani had declared a week-long ceasefire with the Taliban, the first such declaration since he came to power in 2014. He then extended the ceasefire unilaterally, but was forced to end it after the Taliban did not agree.

Last week, Taliban militants attacked two checkpoints in northern Afghanistan, killing at least 30 soldiers and police personnel. They also set fire to the checkpoints in Baghlan-I Markazi district in Baghlan province. On Friday, Ghani also visited the the southeastern city of Ghazni, which was the site of a five-day battle between Taliban and the security forces, reported Al Jazeera. The offensive killed at least 100 members of the Afghan security forces and 35 civilians.