Duncan Mansfield was born in February 1778 at Albany, New York. He enlisted in the United States Marine Corps at Philadelphia, Pennsylvania on 11 August 1798 and served until 1805. While serving on the schooner during the First Barbary War, Sergeant Mansfield volunteered for the cutting‑out expedition led by Lt. Stephen Decatur, Jr., 16 February 1804. Lieutenant Decatur and his 84‑man crew sailed ketch , disguised as an Arab ship, into Tripoli Harbor to destroy the recently captured U.S. frigate and prevent her use against the United States.