KABUL, Afghanistan — Some Taliban fighters hid inside a sewage tanker truck, hoping the smelly interior would prevent a close inspection — as it did. They rode it into one of the most important military bases in Afghanistan and then hid in an empty warehouse.

Other insurgents used ladders to climb the fences, scaling two sets of them, to cross a no man’s land that had once been protected by motion detectors and infrared cameras but now had only sleepy guards in watchtowers.

The infiltrators had friends in high places, as well, according to Afghan and American military officials: an Afghan lieutenant colonel and a sergeant major who made sure they knew where to go, and where to hide on the sprawling base.

The ensuing attack on Camp Bastion in Helmand Province, on March 1, was not one of the country’s deadliest, but it may well have been its most embarrassing. It was the third time the Taliban had infiltrated that base, the headquarters for the Afghan Army’s 215th Corps.