It was not immediately clear if the president was in the palace in Mogadishu when the attack occurred or if anyone was hurt .