In 1798, Barron was placed in command of the and took part in the Quasi-War with France. During the First Barbary War, he commanded the and relieved Edward Preble near Tripoli. “Throughout most of the winter of 1804-1805, Barron was prostrated with a painful liver disease, a consequence of yellow fever. For the squadron officers, Barron's health was a subject of continuous concern and frustration…and in early November 1804, he moved ashore - yet he refused to give up command and never stopped hoping that he would recover.” In 1805 he turned over command of his squadron to John Rodgers and returned to the United States due to poor health. He was then assigned command of the Gosport Shipyard in Virginia. His health never fully recovered and on 29 October 1810 Lt. Robert Henley his executive officer reported to the Secretary of the Navy "I have the painful duty to inform you of the death of Commodore Samuel Barron. In apparent good health, he was attacked while at dinner yesterday in Hampton with an apoplectic fit and expired about 10 o'clock this morning." Commodore Barron was buried at Hampton Virginia age 45.