KABUL (Reuters) - Afghan authorities have detained 24 people in connection with what appears to have been an insider attack on a military hospital in Kabul last week, including some of the staff, officials said on Wednesday.

However they stonewalled a growing chorus of questions about how it was possible for gunmen to get into Afghanistan’s largest military hospital, just a stone’s throw from the heavily fortified U.S. embassy in the heart of the capital.

“We are working on evidence to find out if someone has been involved from the hospital,” Deputy Defense Minister Helaludin Helal told a news conference in Kabul. “The process is complicated and it takes time.”

At least 50 people were killed and more than 30 wounded in what security officials say was a well-coordinated operation, involving at least five gunmen dressed as medics.

The attack was claimed by Islamic State, although some officials say the group, based mainly in eastern Afghanistan, was unlikely to have been capable of mounting such a sophisticated operation without help from more experienced groups, such as the feared Haqqani network.

The Taliban, the biggest insurgent group, denied any involvement but the attack underlined the growing insecurity in Afghanistan ahead of the warmer spring weather, when fighting often increases in intensity.

Gunmen armed with automatic weapons and hand grenades infiltrated the 400-bed hospital and went through the wards, shooting and stabbing patients, medical staff, security personnel and visitors.

Although Helal refused to confirm that the attackers had entered the grounds before the attack began, several officials have said that they were helped by staff, who were able to use their knowledge of the site to guide the attackers.

“Without inside help, this would not have been possible,” said one official, speaking on condition of anonymity because he was not authorized to talk to the media. He said one staff member in particular was the focus of attention.

“He had a badge to access all hospital wards and could bring his car inside the compound without check,” the official said. “Doctors and the head of the hospital know him very well.”

Around an hour after the attack began, a car packed with explosives blew up in the hospital grounds, where it appeared to have been parked for several days.

Helal declined to say who the government believes was behind the attack, saying only that the attackers had been able to exploit lapses in security.