In , Davis was elected as a representative to the House of Representatives. However, in June , he resigned to command the Mississippi Regiment in the Mexican-American War. Under the command of Zachary Taylor, he distinguished himself at the sieges of Monterrey and Buena Vista.