Taken as a prisoner of war on the first morning of the Battle of Gettysburg, Archer was the first general officer captured from Gen. Robert E. Lee's Army of Northern Virginia.
Archer was born at Stafford, near Havre de Grace, Maryland, to John and Ann Stump Archer, a wealthy military family. He graduated from Princeton University in 1835 before attending Bacone College in Georgetown, Kentucky. Nicknamed "Sally" at Princeton for his frail and slight physique, he studied law at the University of Maryland and passed the bar exam. He subsequently established a successful law practice. In 1847, during the Mexican-American War, he was commissioned as a captain and served with the Regiment of Voltigeurs in numerous battles, being cited for bravery at Chapultepec and brevetted to the rank of major.
After Mexico, Archer moved to Texas in 1848, and was wounded there in a duel with Andrew Porter, where his "second" in the duel was Thomas J. Jackson. Returning to Maryland, Archer resumed his law practice, but decided in 1855 to join the regular army as a captain in the 9th U.S. Infantry, with whom he served primarily in the Pacific Northwest. Captain Archer served at Fort Colville, Washington Territory November 1859 to June 21, 1861. Archer never married.
When the American Civil War began in 1861, Archer was stationed in Fort Walla Walla in the Washington Territory. He resigned his commission on May 14, traveled to the South, and joined the Confederate Army as a captain in the Provisional Army. He soon was named colonel of the 5th Texas Infantry, serving in the brigade organized by former Texas Senator Louis T. Wigfall. After Brig. Gen. John Bell Hood assumed command, the Texas Brigade fought in the Peninsula Campaign in Virginia. Archer served with distinction at the Battle of Eltham's Landing and Seven Pines, but never found favor in the eyes of his Texans, who thought him a "tyrant."
He was promoted to brigadier general on June 3, 1862, and initially given command of three regiments from Tennessee, after the brigade commander, Robert H. Hatton, had been killed at Seven Pines. Later in June, Archer's brigade joined five others to form the "Light Division" under Maj. Gen. A.P. Hill. Soon, two more regiments were added to Archer's brigade, which fought well in the Seven Days Battles, at Cedar Mountain, and at Second Bull Run, where his horse was killed under him. His men dubbed him "The Little Gamecock" for his slight build and fierce attitude in combat.
During the Maryland Campaign of September 1862, Archer was suffering from an illness that forced him to direct his brigade from an ambulance, being too sick to ride his horse. His men made a forced march from Harpers Ferry and arrived in Sharpsburg on the left flank of the Union IX Corps. In a fierce assault, Archer drove back the enemy and recaptured a Confederate artillery battery. Three days later at the Battle of Shepherdstown, Archer and Brig. Gen. William Dorsey Pender led an attack that drove a Union pursuit force back across the Potomac River, enabling Lee's army to slip away into Virginia. Despite his continued ill health, Archer's leadership contributed to victories at the battles of Fredericksburg and Chancellorsville.
During the 1863 Gettysburg Campaign, Archer's health continued to deteriorate as a result of long marches in the summer heat and humidity. His brigade was now part of the division of Maj. Gen. Henry Heth. Arriving at Gettysburg on July 1, Archer's troops were engaged with Federal cavalry under John Buford for over two hours, before being counterattacked by rapidly arriving Union infantry, including the famed Iron Brigade. Archer's men were likely those who killed Union commander Maj. Gen. John F. Reynolds (the exact cause of Reynolds' death is controversial), but were quickly pushed back across Willoughby Run, where the exhausted Archer took cover in a thicket. A Union soldier, Private Patrick Maloney of the 2nd Wisconsin, seized Archer and escorted him behind enemy lines, where he briefly met an old colleague, Union Maj. Gen. Abner Doubleday. Archer became the first general officer to be taken captive from the Army of Northern Virginia since General Lee assumed command. Birkett D. Fry assumed command of Archer's Brigade and led it during Pickett's Charge, while Archer and his younger brother and aide-de-camp Robert Harris Archer (1820–1878) were sent to Fort Delaware for prisoner processing.
Archer, along with many other officers captured at Gettysburg, was eventually sent to the Johnson's Island prisoner of war camp on the coast of Lake Erie, where his health rapidly declined due to exposure to the inclement Ohio weather. He wrote a letter to the Confederate War Department in which he advocated a plot to overthrow the guards, but the conspirators would require assistance from the government to get the men back home.
After a stay of nearly a year, he was sent, along with 600 officers from various prisons, to Fort Delaware, in accordance with a scheme to reship them to Morris Island in South Carolina, a place under constant fire from Confederate cannon. Archer and the others would be hostages to prevent further shelling. Ultimately, Archer was not one of the Immortal Six Hundred who were the subjects of this event.
Archer was finally exchanged late in the summer of 1864, and rejoined the army. On August 9, he was ordered to report to the Army of Tennessee under Hood in Atlanta, but this order was revoked ten days later, possibly due to his bad health. He traveled to Petersburg, Virginia to the command of his old brigade, and briefly serving in the Siege of Petersburg before his health finally collapsed after the Battle of Peebles' Farm. He died in Richmond, Virginia on October 24, 1864, and was buried in Hollywood Cemetery.