When did the United States first conquer a foreign capital?

On September 14, 1847, during the Mexican War, U.S. troops under the command of General Winfield Scott occupied Mexico City.

Mexico made peace with the U.S. in 1848.