Born in Kentucky in 1805, Anderson attended West Point and earned distinction in the Black Hawk War of 1832. He also fought in Florida's Seminole War before serving in the Mexican-American War under Winfield Scott. He rose to the rank of major prior to the outbreak of the Civil War. Although he was pro-slavery and pro-South, Anderson remained loyal to the United States.
When Abraham Lincoln won the presidential election in November 1860, tension rose dramatically around Federal installations in the South. Anderson was assigned to command Fort Sumter in Charleston Harbor in hopes that a pro-South officer would help smooth tensions with local residents. From the time South Carolina seceded on December 20, 1860, until the Confederates fired on the fort on April 15, 1861, Anderson politely dealt with the Charlestonians in a deteriorating climate. When he surrendered the fort after a 36-hour bombardment, he was hailed a national hero.
Released by Confederates nearly six weeks after the surrender of Fort Sumter, Anderson was promoted to brigadier general. He was given command of the Department of Kentucky and carefully maintained the balance of neutrality in the state. But poor health forced him to resign his command two months later, and William T. Sherman replaced him. Anderson returned to active duty briefly in 1865 to hoist the American flag over Fort Sumter after the Confederate surrender. He died in 1871 and was buried at West Point.