With the outbreak of the Civil War, Harker was assigned to duty in Ohio to help train newly recruited volunteer soldiers. He was promoted to first lieutenant of the 15th U.S. Infantry on May 14, 1861, and then to captain on October 24, 1861. He was subsequently appointed as colonel of the 65th Ohio Infantry, a regiment in the forces of Brig. Gen. Don Carlos Buell. He became the regiment's colonel on November 11, 1861. Harker and the 65th OVI participated in the April 1862 Battle of Shiloh, as well as the subsequent Siege of Corinth, Mississippi. In late June, he took over command of the 20th Brigade, 6th Division, Army of the Ohio, replacing James A. Garfield. Later that year, he was involved in the Battle of Perryville in Kentucky. Harker received praise for his significant contributions during the Battle of Stones River at the end of the year while leading the 3rd Brigade, 1st Division, Left Wing of XIV Corps of the Army of the Cumberland. In 1863, he was in command of the 3rd Brigade, 2nd Division, IV Corps, Army of the Cumberland, Military Division of the Mississippi. He again drew the attention of his senior commanders with a determined stand against Confederate attackers during the Battle of Chickamauga in northern Georgia. In recognition of his performance and service, he was promoted to fill an opening as a brigadier general, dating from September 20, 1863. After participating in the fighting around Chattanooga and the assault on Missionary Ridge, he and his men helped relieve Maj. Gen. Ambrose E. Burnside during the Siege of Knoxville. In mid-1864, as the Atlanta Campaign began, Harker commanded a brigade under Maj. Gen. Oliver O. Howard. On May 7, he successfully held the peak of Rocky Face Ridge despite determined Confederate efforts to dislodge his men. In June William T. Sherman's Union army attempted to displace Confederate troops from their fortifications on Kennesaw Mountain. Harker was shot from his horse and mortally wounded during a failed attack on June 27, 1864. His body was shipped back to his native Swedesboro, New Jersey, where it was buried in Trinity Episcopal Church Cemetery.
In popular culture
Harker is portrayed by Bob Gunton in the 1989 Civil War film, Glory. Unlike the real Harker, who died at 26, for dramatic purposes, the film portrays him as an older general who authorizes plunder and corruption among his subordinates. He was also never promoted to Major General, and never served around Charleston.