Afghan special forces have arrested a Taliban operative responsible for two major attacks in Kabul, the country’s intelligence agency said.

In a separate operation, agents also apprehended a university professor who they described as a top recruiter for Isis.

In a statement on Saturday, the Afghan National Directorate of Security said the Taliban operative, Mohammad Sharif, was the mastermind behind a horrific truck bombing that killed 150 people in Kabul’s diplomatic area in May 2017.

He was also accused of planning a suicide bombing last November that killed five employees of a multinational security company.

Officials said Sharif had studied at a madrassa in Quetta, Pakistan, where the Afghan Taliban leadership is based. He was arrested along with two Taliban members accused of helping in the two attacks, intelligence officials said.

There have been relatively few terrorist attacks in Kabul in recent months, due in part to a major security sweep of the capital by the intelligence agency and the Afghan security forces, backed by US military advisers.

The May 2017 truck bombing devastated the central area of Kabul near the presidential palace and foreign embassies, wounding 300 people.

The truck exploded at the peak of rush hour, when the streets were packed. The German Embassy was badly damaged, and some of its staff members were injured. The Japanese and Pakistani embassies said some of their staff members were also wounded.

In the November 2018 attack, the Taliban struck a compound in Kabul used by the multinational security company G4S, wounding 32 people.

Truck bomb strikes Kabul's diplomatic quarter - May 2017 Show all 10 1 /10 Truck bomb strikes Kabul's diplomatic quarter - May 2017 Truck bomb strikes Kabul's diplomatic quarter - May 2017 Afghan security forces attend the scene of the truck bombing in Kabul AFP/Getty Truck bomb strikes Kabul's diplomatic quarter - May 2017 Security forces and resident look on at the crater left by the bombing AFP/Getty Truck bomb strikes Kabul's diplomatic quarter - May 2017 Afghan security forces personnel attend the site of a truck bomb in Kabul on May 31 2017 AFP/Getty Truck bomb strikes Kabul's diplomatic quarter - May 2017 Foreign security forces and Afghan private security personnel attend the scene of a truck bomb in Kabul on May 31 2017 AFP/Getty Truck bomb strikes Kabul's diplomatic quarter - May 2017 An Afghan resident sits inside a damaged car at the site of a truck bomb attack in Kabul on May 31, 2017 AFP/Getty Truck bomb strikes Kabul's diplomatic quarter - May 2017 Injured Afghan men receive medical treatment at a hospital in Kabul the day after the attack AFP/Getty Truck bomb strikes Kabul's diplomatic quarter - May 2017 A wounded man is assisted at the site of the truck bombing AFP/Getty Truck bomb strikes Kabul's diplomatic quarter - May 2017 A dog is seen running at the site of a truck bomb attack in Kabul on May 31 2017 AFP/Getty Truck bomb strikes Kabul's diplomatic quarter - May 2017 A victim of the bombing is carried to an ambulance on May 31 2017 AFP/Getty Truck bomb strikes Kabul's diplomatic quarter - May 2017 A victim of the bombing is carried to an ambulance on May 31 2017 AFP/Getty

A suicide bomber breached the compound’s defences and four attackers held out inside for 11 hours before they were subdued by police.

Officials said 194 foreigners and 36 Afghans survived after hiding inside a safe room in the compound.

In the other case, the intelligence agency accused Abu Obaidullah Mutawakel, a university professor and imam at a Kabul mosque, of recruiting hundreds of young men for Isis and sending them to a stronghold for the group in Nangarhar province. A nephew of the professor carried out a suicide attack in Kabul two months ago, the agency said.