The Fifth Texas Infantry Regiment was organized by the Confederate War Department in Richmond, Virginia, in October 1861. The men of the Fifth Texas Infantry were recruited primarily from the Texas counties of Colorado, Harris, Jefferson, Leon, Liberty, Milam, Montgomery, Polk, Trinity, Walker, and Washington. The unit was organized into ten companies. These companies had nicknames attached to them to denote their area of origin. For example, Company A was known as the Bayou City Guards, Company C as the Leon Hunters, Company D as the Waverly Confederates, Company E as the Dixie Blues, Company F as the Invincibles, Company G as the Milam County Grays, Company H as the Texas Polk Rifles, Company I as the Texas Aides, and Company K as the Polk County Flying Artillery.
Along with the First and Fourth Texas Infantry regiments, the Fifth Texas Infantry made up the famous Hood's Texas Brigade of Robert E. Lee's Army of Northern Virginia. As part of Hood's Texas Brigade, the unit served under generals John Bell Hood, Jerome B. Robertson, and John Gregg. The Fifth Texas's original commander was Col. James J. Archer. The unit had numerous field officers during the war. These officers included: Walter B. Botts (major, lieutenant colonel), King Bryan (major, lieutenant colonel), Robert M. Powell (major, lieutenant colonel, colonel), Paul J. Quattlebaum (major), Jerome B. Robertson (lieutenant colonel and colonel before he became commanding general), Jefferson C. Rogers (major), John C. Upton (major, lieutenant colonel), and David M. Whaley (major).
The Fifth Texas participated in nearly every campaign waged by the Army of Northern Virginia. It saw its first action on May 7, 1862, in an engagement at West Point, Virginia. Over the course of 1862, the unit participated in numerous skirmishes and actions, including the major battles of Seven Pines, Seven Days, Second Manassas, Antietam, and Fredericksburg. On June 3, 1862, after the Seven Days battles, Col. James J. Archer was promoted to the rank of brigadier general and ordered to command a brigade of Tennessee troops. As a result, Jerome B. Robertson was promoted to the rank of colonel and took over command of the Fifth Texas. However, following the battle of Antietam, General Hood was promoted to the rank of major general. To fill the vacancy left by Hood, Robertson was promoted to brigadier general and assumed command of the brigade which he held until late summer of 1863. Thus, command of the Fifth Texas passed to Robert M. Powell.
In 1863 the Fifth Texas was involved in various actions in Virginia, Pennsylvania, Georgia, and Tennessee. It participated in the major battles of that year including Gettysburg where, of the unit's 409 effectives engaged, more than half became casualties. The Fifth Texas also participated in actions in the Western Theater as part of Gen. James Longstreet's Corps. While there, the unit was involved in the battle of Chickamauga, the siege of Chattanooga, and the siege of Knoxville. The Fifth Texas remained in the Western Theater through January 1864, after which it returned to Northern Virginia.
In Virginia, the Fifth Texas participated in actions against Ulysses S. Grant's Overland campaign of 1864. The unit fought in the battles of Wilderness, Spotsylvania, and Cold Harbor. As the Union Army encircled Richmond and Petersburg, the Fifth Texas was engaged in operations in defense of those two cities. When the defense of the Confederate capital broke down, the Fifth Texas—as part of the Army of Northern Virginia—retreated west and took part in the Appomattox campaign that resulted in the surrender of Lee's forces at Appomattox Courthouse, Virginia, on April 9, 1865. The unit surrendered 12 officers and 149 men at Appomattox. In spite of its low numbers, the Fifth Texas was the largest unit of the Texas Brigade to surrender its arms.