The regiment was formed as the 127th Ohio Volunteer Infantry at Camp Delaware, Ohio. It was re-designated the 5th Regiment, United States Colored Troops, and moved to Norfolk, Virginia, in November 1863, immediately after three months of organization. It served at Norfolk and Portsmouth in the Department of Virginia and North Carolina until January 1864, during which time the unit participated in Brigadier General Edward A. Wild's expedition to South Mills and Camden Court House, North Carolina, from December 5 to December 24 and in action at Sandy Swamp, North Carolina, on December 8.

The 5th was then moved to Yorktown, Virginia where it became part of the XVIII Corps and was involved in several expeditions: Wistar's Expedition against Richmond from February 6 to February 8, 1864, an expedition to New Kent Court House in aid of Brigadier General Hugh Judson Kilpatrick's cavalry from March 1 to March 4 (including action at New Kent Court House on March 2), an expedition into King and Queen County from March 9 to March 12, and an expedition into Mathews and Middlesex Counties from March 17 to March 21.

The 5th participated in the capture of City Point, Virginia, on May 4, 1864 and while in the city the regiment served fatigue duty, built Fort Converse on the Appomattox River, defended an attack against Fort Converse on May 20, and took part in Brigadier General Benjamin F. Butler's operations on the south side of the James River and against Petersburg and Richmond. The unit participated in action at Bailor's Farm on June 15, 1864 before taking part in the Richmond–Petersburg Campaign from June 16 to December 6, 1864. The 5th served in the trenches around Petersburg, seeing action there during the Battle of the Crater on July 30.

On August 28, 1864, the regiment moved to Deep Bottom in Henrico County, Virginia, and subsequently participated in the Battle of Chaffin's Farm and Fort Harrison from September 28 to September 30 and the Battle of Fair Oaks from October 27 to October 28 before returning to the trenches, this time near Richmond. Four men of the 5th Regiment received the Medal of Honor for their actions at Chaffin's Farm: Powhatan Beaty, James H. Bronson, Milton M. Holland, and Robert Pinn.

In December the unit was assigned to the newly-formed XXV Corps and took part in the failed attack on Fort Fisher, North Carolina, from December 7 to December 27, 1864 and the successful Second Battle of Fort Fisher from January 7 to January 15, 1865. The 5th then saw action at Sugar Loaf Hill on January 19 and at Federal Point on February 11 before taking part in the Battle of Wilmington at Fort Anderson from February 18 to February 20 and the capture of Wilmington as well as action at Northeast Ferry on February 22, 1865.

In March 1865, the 5th Regiment was re-assigned to the X Corps and took part in General William Tecumseh Sherman's Carolinas Campaign. The unit saw action during the advance on Kinston and Goldsboro, North Carolina, starting on March 6 and occupied Goldsboro after its capture on March 21. The regiment saw further action at Cox's Bridge on March 23 and March 24 and participated in the advance on Raleigh, North Carolina, starting on April 9 and the occupation of Raleigh after the city's fall on April 14. With the end of the war at hand, the men of the 5th witnessed the surrender of Confederate General Joseph E. Johnston and his army at Bennett Place, North Carolina, on April 26, 1865. The unit served out the rest of its term in Goldsboro, New Bern, and Carolina City, North Carolina.

The 5th was mustered out on September 20, 1865 after two years of existence. The regiment lost a total of 249 men during its service; four officers and 77 enlisted men were killed or mortally wounded and two officers and 166 enlisted men died of disease.