Lane joined the Confederate Army and was commissioned as a major in the 1st North Carolina Volunteers on May 11, 1861. He participated in the Battle of Big Bethel and was made lieutenant colonel. Further promotion came quickly and he was a colonel and commander of the 28th North Carolina Infantry Regiment by September 15. In the Seven Days Battles of 1862 he was twice wounded leading his regiment. He served in Major General A.P. Hill's division of Thomas J. "Stonewall" Jackson's Second Corps for Second Bull Run and took over brigade command following the death of Brigadier General Lawrence O. Branch at the Battle of Antietam. He was promoted to brigadier general on November 1, 1862. It was soldiers of Lane's brigade that accidentally shot General Jackson as he returned from a nighttime scouting trip in front of the Confederate lines during the Battle of Chancellorsville. Lane's command became the 2nd Brigade in W. Dorsey Pender's division of Hill's Third Corps of the Army of Northern Virginia the following May, directly before the beginning of the Gettysburg Campaign. At the Battle of Gettysburg, Lane's brigade fought on the first day and Lane briefly assumed command of Pender's division following that officer's mortal wounding on the second day. He was replaced in division command by Major General Isaac R. Trimble and returned to lead his brigade during Pickett's Charge, during which he was wounded when his horse was shot from under him. Over the three-day battle, his brigade suffered almost 50% casualties. When Trimble was wounded in the attack, Lane resumed temporary command of the division. In 1864, Lane continued in brigade command, through the Overland Campaign and Siege of Petersburg. In June, at the Battle of Cold Harbor, he was wounded in the groin. In February and March 1865, he commanded Cadmus M. Wilcox's division. He continued to serve during the Appomattox Campaign, where he was paroled from Appomattox Court House after Robert E. Lee's surrender on April 9.
Lane Hall, originally known as Barracks No. 1, on the Virginia Tech campus is named for General Lane. The barracks housed 130 cadets until it was converted into academic offices in 1967. Built in 1888, Lane Hall is listed on the Virginia Landmarks Register and National Register of Historic Places. The Lane Residence Hall, a co-ed residence hall in the Lower Quad on the Auburn University campus is named for General Lane. A klavern based in Auburn, Alabama, that was in existence by 1923 was named after General Lane.