William Lamb was born into a prominent Hampton Roads, Virginia family on September 7, 1835. He attended Rappahannock Military Academy and, in 1855, graduated from the College of William and Mary. He became editor of the Norfolk Southern Daily Argus and was also a lawyer. He commanded a local militia company called the Woodis Rifles and was present at the execution of abolitionist John Brown.
In May 1861, the Woodis Rifles manned an artillery battery at Sewell's Point, Virginia in a skirmish with the USS Monticello. The Woodis Rifles were taken into the Confederate service as the 6th Virginia Infantry, but Lamb left the unit to accept an assignment in North Carolina. In October 1861 he was named chief quartermaster on the staff of Brig. Gen. Joseph R. Anderson, commanding the District of the Cape Fear.
On May 11, 1862 Anderson placed then Major Lamb in command of the recently constructed fortifications at the colonial town of Brunswick, which Lamb christened Fort St. Philip (renamed Fort Anderson on July 1, 1863), after the remains of the colonial Anglican church on the site. Three days later, on May 14, Lamb was elected colonel of the 36th North Carolina (2nd North Carolina Artillery). On July 4, 1862 Lamb was selected as the new commandant of Fort Fisher, an installation that he felt was in no way complete. Lamb, along with his wife Daisy and two children, relocated across the Cape Fear River to his new command. His troops constructed a small cottage for the family approximately one-half mile north of the fort.
For two and a half years, Lamb oversaw the construction of the most massive earthen fortification in the Confederacy. He worked his garrison relentlessly, trying to build up the peninsula's defenses. He even used enslaved persons, whose time was either donated to or impressed by the government to assist in the building of the fort. Lamb was still not satisfied that his work was complete when the fort was first attacked on December 24-26, 1864. The first attack proved unsuccessful for the Union forces, but they returned on January 13, 1865 to renew their efforts. Desperately defending the fort on January 15, Lamb was shot in the hip, relinquished command to Maj. James Reilly, and was taken prisoner when the fort was captured. He was sent, along with other officers, to Fort Columbus, Governor's Island, New York.
After the war, Lamb returned to Norfolk and established a successful shipping business. He served three terms as mayor of Norfolk from 1880 to 1886. He died in 1909.