Witnesses described a firefight lasting over an hour, with US helicopters called in for air support.
The attack was carried out by the American forces, and the Somali government was pre-informed about the attack, said a Somali official.
A spokesman for the Shabab said that one of their fighters had been killed but the group claimed it had beaten back the US commando assault.
American officials initially reported that they had seized the Shabab leader, but later backed off their claim.
A United States official said that no Americans had been killed or wounded and that the Americans “disengaged after inflicting some Shabab casualties.”
During the Westgate shopping mall massacre in Nairobi, FBI had sent dozens of agents to take part in the probe. This morning's commando attack was an outcome of that involvement.
A witness in Baraawe said the house was known as a place where senior foreign commanders stayed. He could not say whether they were there when the attack began, but he said 12 well-trained Shabab fighters scheduled for a mission abroad were staying there at the time of the assault.
A spokesman for the Kenyan military said Saturday that it had identified four of the attackers at Westgate shopping mall from surveillance footage as Abu Baara al-Sudani, Omar Nabhan, Khattab al-Kene and a man known only as Umayr.
The spokesman, Maj. Emmanuel Chirchir, said none of the militants had escaped the mall. “They're all dead,” he said.
The footage, broadcast on Kenyan television on Friday night, showed four attackers moving about the mall with cool nonchalance.