Local residents reported heavy blasts and gunfire at Baledogle airport in the southern Lower Shabelle region.
The al-Shabab militant group said it had carried out the attack, using a car bomb to blast through the gates before sending its fighters inside.
Military officials say the jihadists were repulsed without breaching the perimeter fence.
No casualties were reported among the Somali military.
In a statement, US Ambassador Donald Yamamoto praised the Somali military for their “alertness and swift response”.
“This attack yet again demonstrates al-Shabab violently opposes progress towards peace and prosperity in Somalia,” he said.
Al-Shabab said in a statement it had launched the raid, adding: “After breaching the perimeters of the heavily fortified base, the mujahideen [holy warriors] stormed the military complex, engaging the crusaders in an intense firefight.”
The base, about 100km (60 miles) west of the capital Mogadishu, is said to house US special forces, Somali special forces and Ugandan peacekeepers. It is used as a launch site for US drones as well as being a training centre.