During the War of 1812, which lasted from 1812 to 1815, an incident occurred at the time of the burning of Washington, D.C., when the sheriff's office became involved in an occurrence that led to the writing of the U.S. national anthem. As the British Army marched from Washington they passed through Prince George's County. Because the residents had cooperated with the British, the commander ensured that minimal damage was inflicted upon the local residents and their property. After the Battle of Bladensburg, the British Army returned to the area of Upper Marlboro. However, this time some of the British soldiers looted local farms. A sheriff's posse subsequently arrested the offending soldiers and placed them in the county jail. Upon learning about the arrest of his soldiers, the British commander ordered the arrest of the sheriff and the posse in turn. One of the posse members was Dr. William Beam. Beam was ultimately arrested and held for ransom on a British warship. Beam's brother-in-law, Francis Scott Key, went to Baltimore Harbor in search of him. He witnessed the British fleet under attack which was the inspiration of "The Star-Spangled Banner".