WASHINGTON — A United States service member and two American military contractors died on Sunday in an attack on a Kenyan military base that the Pentagon said was carried out by the Islamic extremist group the Shabab.

The attack at the military airstrip at Manda Bay, Kenya, early Sunday involved small-arms and other hostile fire, according to a statement by the military’s Africa Command. Fighters from the Shabab, an East African terrorist group affiliated with Al Qaeda, fought their way onto the base before Kenyan and American troops drove them back.

In the past several years, Manda Bay was used by Army Green Berets as an outstation where they both trained Kenyan Rangers — who had their own training center there — and supervised them as they crossed over the border into neighboring Somalia to fight the Shabab.

But recently, the Green Berets were replaced with units from both the Navy SEALs and Marine Special Operations teams. According to military officials, the base has been problematic at best, with cross-border operations rarely going ahead as planned, prompting American officials to consider ending their use of parts of the base altogether.