Built by the citizens of Essex County, Massachusetts, who presented her to the US Government, USS Essex was commissioned under command of Captain Edward Preble. On her first voyage in 1800, during the war with France, Essex helped convoy a fleet of Dutch East Indiamen through the Indian Ocean. In 1801 she was one of several ships sent to the Mediterranean to contain the Barbary Corsairs harassing American shipping. She sailed first under Captain William Bainbridge and then under Captain James Barron. Following the war, she was laid up from 1806 to 1809. At the beginning of the war of 1812, under command of Captain David Porter, Essex captured ten prizes, including HMS Alert (18 guns) between July and September.