Maury served in the Mexican–American War at the Battle of Cerro Gordo, and suffered a painful wound that almost resulted in the amputation of his arm. He was soon sent home to recuperate and was brevetted to First Lieutenant for bravery. His gallantry in this event prompted the citizens of Fredericksburg and the Legislature of Virginia to honor him with a special presentation sword. After further convalescence in White Sulphur Springs, he was reassigned to West Point as an instructor, serving in that capacity from 1847 until 1852. He then returned to active field duty with the Mounted Rifles, serving in the Oregon Territory, then on the Texas frontier. He returned East and commanded the Cavalry School at the Carlisle Barracks in 1858. He authored a book, "Tactics for Mounted Rifles", which became the standard textbook. He also wrote "Recollections of a Virginian in the Indian, Mexican, and the Civil Wars".