The officer was reported to be involved in a CIA operation against the jihadist organization Al-Shabab, which is waging an insurgency in the country.
With double the number of airstrikes of 2016 and 400 U.S. soldiers on the ground, Washington's role in Mogadishu is expanding.
The driver of the truck reportedly came from a town outside Mogadishu, where a U.S.-led raid mistakenly killed 10 civilians in August.
Washington has been targeting the Al-Qaeda affiliate with airstrikes since at least 2007.
Eritrea's navy also was placed under U.S. sanctions in April, after a shipment of military equipment from North Korea was found en route to the country.
Al-Shabab, which has ties to Al-Qaeda, is trying to oust the Western-backed government in Somalia.
Somalia's Al-Qaeda affiliate killed 4,300 people in 2016, making it Africa's biggest militant threat.
Akinwumi Adesina tells Newsweek that the U.S. must continue its support for Africa to stop militants thriving.
The State Department's acting deputy tells Newsweek that the U.S. is prepared to make sacrifices for Somalia's security.
The death is the first U.S. military casualty in Somalia for more than 20 years.
Somalia's ambassador to the U.S. says 4,000 people are being deported back to the conflict zone.
Somalia's president said that the country is in a "state of war" against the Al-Qaeda affiliate, which carried out deadly attacks on Sunday and Monday.
Somalia's currency collapsed after the outbreak of civil war.
Hassan Ali Khaire is also a dual Norwegian-Somali citizen.
The car bomb attack also injures around 50 people, days after Somalia elected a new president.
Somalia is at risk of another deadly famine, six years after the last killed 250,000 people.
"If the mightiest country in the world is afraid of the most vulnerable, what example does that set for some of the poorest?"
The hotel is popular with government officials and journalists.
The al-Qaeda-linked group claimed to have held the soldier since September 2015.