Question: When did the president of the Confederate States of America end his fight in the Mexican-American war?

Context paragraphs:
paragraph_text: The Texas Revolution (October 2, 1835 -- April 21, 1836) was a rebellion of colonists from the United States and Tejanos (Texas Mexicans) in putting up armed resistance to the centralist government of Mexico. While the uprising was part of a larger one that included other provinces opposed to the regime of President Antonio López de Santa Anna, the Mexican government believed the United States had instigated the Texas insurrection with the goal of annexation. The Mexican Congress passed the Tornel Decree, declaring that any foreigners fighting against Mexican troops ``will be deemed pirates and dealt with as such, being citizens of no nation presently at war with the Republic and fighting under no recognized flag. ''Only the province of Texas succeeded in breaking with Mexico, establishing the Republic of Texas, and eventually being annexed by the United States.
title: Texas Revolution
paragraph_text: The president was indirectly elected by the people through the Electoral College to a six - year term, and was one of only two nationally elected Confederate officers, the other being the Vice President. On February 18, 1861, Jefferson Davis became president of the provisional government. On February 22, 1862, he became president of the permanent government and served in that capacity until being captured by elements of the United States Cavalry in 1865.
title: President of the Confederate States of America
paragraph_text: USS "Cactus" (1863) was a steamer acquired by the Union Navy during the American Civil War for service with the Union blockade of the ports and waterways of the Confederate States of America.
title: USS Cactus (1863)
paragraph_text: Jefferson Davis was named provisional president on February 9, 1861, and assumed similar commander - in - chief responsibilities as would Lincoln; on November 6, 1861 Davis was elected President of the Confederate States of America under the Confederate Constitution. Alexander H. Stephens was appointed as Vice President of the Confederate States of America on February 18, 1861, and later assumed identical vice presidential responsibilities as Hannibal Hamlin did. Several men served the Confederacy as Secretary of War, including Leroy Pope Walker, Judah P. Benjamin, George W. Randolph, James Seddon, and John C. Breckinridge. Stephen Mallory was Confederate Secretary of the Navy throughout the conflict.
title: Military leadership in the American Civil War
paragraph_text: Samuel Preston Moore (September 16, 1813 – May 31, 1889) was an American military physician, who served in the medical corps of the United States Army during the Mexican–American War, and later as the Confederate Surgeon General throughout nearly all of the American Civil War.
title: Samuel P. Moore
paragraph_text: The American Civil War caught both sides unprepared. The Confederacy hoped to win by getting Britain and France to intervene, or else by wearing down the North's willingness to fight. The U.S. sought a quick victory focused on capturing the Confederate capital at Richmond, Virginia. The Confederates under Robert E. Lee tenaciously defended their capital until the very end. The war spilled across the continent, and even to the high seas. Most of the material and personnel of the South were used up, while the North prospered.
title: Military history of the United States
paragraph_text: Davis was born in Fairview, Kentucky, to a moderately prosperous farmer, the youngest of ten children. He grew up in Wilkinson County, Mississippi, and also lived in Louisiana. His eldest brother Joseph Emory Davis secured the younger Davis's appointment to the United States Military Academy. After graduating, Jefferson Davis served six years as a lieutenant in the United States Army. He fought in the Mexican–American War (1846–1848), as the colonel of a volunteer regiment. Before the American Civil War, he operated a large cotton plantation in Mississippi, which his brother Joseph gave him, and owned as many as 113 slaves. Although Davis argued against secession in 1858, he believed that states had an unquestionable right to leave the Union.
title: Jefferson Davis
paragraph_text: The Treaty of Guadalupe Hidalgo (Tratado de Guadalupe Hidalgo in Spanish), officially entitled the Treaty of Peace, Friendship, Limits and Settlement between the United States of America and the Mexican Republic, is the peace treaty signed on February 2, 1848, in the Villa de Guadalupe Hidalgo (now a neighborhood of Mexico City) between the United States and Mexico that ended the Mexican -- American War (1846 -- 48). The treaty came into force on July 4, 1848.
title: Treaty of Guadalupe Hidalgo
paragraph_text: The Confederate States Army (C.S.A.) was the military ground force of the Confederate States of America (Confederacy) during the American Civil War (1861 - 1865). On February 28, 1861, the Provisional Confederate Congress established a provisional volunteer army and gave control over military operations and authority for mustering state forces and volunteers to the newly chosen Confederate president, Jefferson Davis (1808 - 1889), a graduate of the U.S. Military Academy on the Hudson River at West Point, New York, and colonel of a volunteer regiment during the Mexican -- American War (1846 - 1848), later a United States Senator from Mississippi and U.S. Secretary of War in the administration of 14th President Franklin Pierce (1853 - 1857). By March 1861, the Provisional Confederate Congress expanded the provisional forces and established a more permanent Confederate States Army.
title: Confederate States Army
paragraph_text: The Confederate States Army (C.S.A.) was the military land force of the Confederate States of America (Confederacy) during the American Civil War (1861 - 1865). On February 28, 1861, the Provisional Confederate Congress established a provisional volunteer army and gave control over military operations and authority for mustering state forces and volunteers to the newly chosen Confederate president, Jefferson Davis (1808 - 1889). Davis was a graduate of the U.S. Military Academy on the Hudson River at West Point, New York, and colonel of a volunteer regiment during the Mexican -- American War (1846 - 1848). He had also been a United States Senator from Mississippi and U.S. Secretary of War in the administration of 14th President Franklin Pierce (1853 - 1857). On March 1, 1861, Davis assumed control of the military situation at Charleston, South Carolina on behalf of the Confederate States government, where South Carolina state militia threatened to seize Fort Sumter, an island fortification in Charleston harbor from the small U.S. Army garrison. By March 1861, the Provisional Confederate Congress expanded the provisional forces and established a more permanent Confederate States Army.
title: Confederate States Army
paragraph_text: The Confederate States Secretary of State was the head of the Confederate States State Department from 1861 to 1865 during the American Civil War. There were three people who served the position in this time. The department crumbled with the Confederate States of America in May 1865, marking the end of the war.
title: Confederate States Secretary of State
paragraph_text: Rear Admiral James Edward Jouett (7 February 1826 – 30 September 1902), known as "Fighting Jim Jouett of the American Navy", was an officer in the United States Navy during the Mexican–American War and the American Civil War. His father was Matthew Harris Jouett, a notable painter, and his grandfather was Revolutionary War hero Jack Jouett.
title: James Edward Jouett
paragraph_text: The American Civil War was fought in the United States from 1861 to 1865. The result of a long - standing controversy over slavery, war broke out in April 1861, when Confederates attacked Fort Sumter in South Carolina, shortly after Abraham Lincoln was inaugurated. The nationalists of the Union proclaimed loyalty to the U.S. Constitution. They faced secessionists of the Confederate States of America, who advocated for states' rights to perpetual slavery and its expansion in the Americas.
title: American Civil War
paragraph_text: Francis "Frank" Crawford Armstrong (November 22, 1835 – September 8, 1909) was a United States Army cavalry officer and later a brigadier general in the Confederate States Army during the American Civil War. He is also known for being the only Confederate general to fight on both sides during the Civil War.
title: Frank Crawford Armstrong
paragraph_text: Charles Pomeroy Stone (September 30, 1824 – January 24, 1887) was a career United States Army officer, civil engineer, and surveyor. He fought with distinction in the Mexican–American War, earning two brevet promotions for his performance in the conflict. After resigning and surveying for the Mexican Government, he returned to the U.S. Army to fight in the American Civil War.
title: Charles Pomeroy Stone
paragraph_text: The American Civil War was fought in the United States from 1861 to 1865. The result of a long - standing controversy over slavery, war broke out in April 1861, when Confederates attacked Fort Sumter in South Carolina, shortly after President Abraham Lincoln was inaugurated. The nationalists of the Union proclaimed loyalty to the U.S. Constitution. They faced secessionists of the Confederate States of America, who advocated for states' rights to expand slavery.
title: American Civil War
paragraph_text: The White House of the Confederacy is a historic house located in the Court End neighborhood of Richmond, Virginia. Built in 1818, it was the main executive residence of the sole President of the Confederate States of America, Jefferson Davis, from August 1861 until April 1865. It was viewed as the Confederate States counterpart to the White House in Washington, D.C.
title: White House of the Confederacy
paragraph_text: The American Civil War (commonly known as the ``Civil War ''in the United States) was fought in the United States from 1861 to 1865. The result of a long - standing controversy over slavery, war broke out in April 1861, when Confederates attacked Fort Sumter in South Carolina, shortly after Abraham Lincoln was inaugurated. The nationalists of the Union proclaimed loyalty to the U.S. Constitution. They faced secessionists of the Confederate States of America, who advocated for states' rights to perpetual slavery and its expansion in the Americas.
title: American Civil War
paragraph_text: Robert Daniel Johnston (March 19, 1837 – February 1, 1919) was a brigadier general for the Confederate States of America during the American Civil War.
title: Robert Daniel Johnston
paragraph_text: John Ancrum Winslow (19 November 1811 – 29 September 1873) was an officer in the United States Navy during the Mexican–American War and the American Civil War. He was in command of the steam sloop of war during her historic 1864 action off Cherbourg, France with the Confederate sea raider .
title: John Ancrum Winslow

Reasoning steps:
who was the president of confederate states of america >>>> Jefferson Davis
When did Jefferson Davis end his fight in the Mexican-American war? >>>> 1848

Answer: spans: 1848