In 1847, the United States invaded Mexico. This was the Mexican-American War. About it, Ulysses S. Grant said:"...I do not think there was ever a more wicked war than that waged by the United States on Mexico. I had a horror of the Mexican War, and I have always believed that it was on our part most unjust. The wickedness was not in the way our soldiers conducted it, but in the conduct of our government in declaring war. We had no claim on Mexico. Texas had no claim beyond the Nueces River, and yet we pushed on to the Rio Grande and crossed it. I am always ashamed of my country when I think of that invasion."
Here is a footnoted statement from Wikipedia:'A month before the end of the war, Polk was criticized in a United States House of Representatives amendment to a bill praising Major General Zachary Taylor for "a war unnecessarily and unconstitutionally begun by the President of the United States". This criticism, in which Congressman Abraham Lincoln played an important role with his Spot Resolutions, followed congressional scrutiny of the war's beginnings, including factual challenges to claims made by President Polk.' Footnotes: Congressional Globe, 30th Session (1848) pp.93-95
House Journal, 30th Session (1848) pp.183-184
As a member of the House of Representatives, Abraham Lincoln opposed the Mexican-American War.