In January and February 1865 McGlashan commanded the brigade in Simms's absence, but returned to his regiment for the Appomattox Campaign. At the Battle of Sayler's Creek on April 6 he became a Prisoner of War. Some days earlier President Jefferson Davis, priorly to fleeing from Richmond, had signed McGlashan's promotion to brigadier general; but it was not delivered or confirmed by Congress in time. This promotion makes him the last appointed general of the Confederacy. He was brought to the Old Capitol Prison in Washington, D.C., where he was during President Lincoln's assassination. Afterwards he was held in the prison camp on Johnson's Island, Ohio until he was released on July 25, 1865.