Andrew Sterett joined the Navy on 25 March 1798, during the Quasi-War with France. As third lieutenant aboard the newly commissioned frigate Constellation, he participated in the capture of the frigate L’Insurgente.
In February 1800, Sterett was promoted to first lieutenant. Later that year he assumed command of the schooner Enterprise, and captured the privateer L’Amour de la Patrie. Enterprise then sailed to the Mediterranean with Commodore Richard Dale’s squadron against the Barbary pirates. Against Tripoli, Enterprise successfully fought off three boarding attempts, for which President Thomas Jefferson presented Sterett with a sword and awarded his crew an additional month’s pay.
Sterett returned home in March 1803 and resigned from the Navy in 1805. He embarked on a career in the merchant marine but died at Lima, Peru on 9 June 1807 at the age of thirty.