An American soldier was also killed when a bomb exploded in western Baghdad .