He served in "Constitution" and other ships of the Mediterranean Squadron from 1800 to 1804, at the height of America's war with Tripoli. Under Commodore Edward Preble's command, he took part in the 1804 blockade of Tripoli and was among those honored by Congress for services rendered during that action.