At least eight people were killed Friday when militants attacked a hotel frequented by government officials in the heart of Mogadishu, Somalia's capital, police said.