Peace with France freed the Navy for operations against
Barbary corsairs who had been preying on American shipping in the Mediterranean. A small squadron under Commodore
Richard Dale, sent out in 1801 for operations against
Tripoli, was followed in 1802 by a much stronger force under Commodore
Richard Valentine Morris. In a letter dated 25 August 1802 Captain
John Rodgers was ordered to take command. On 22 October she sailed from
Hampton Roads to join Commodore Morris. She arrived at Gibraltar on 10 December. After escorting vessels from
Gibraltar to
Málaga and
Menorca, she finally caught up with Commodore Morris at
Malta on 5 January 1803. She then operated with the squadron until 3 May when she received orders to cruise independently off Tripoli. Upon arriving off Tripoli, 8–9 May 1803, she, still under the command of Rodgers, boldly attacked the forts and the gunboats anchored under their protection. There was an exchange of fire with the gunboats the next day also. On 12 May she captured 28-gun former Tripolitan cruiser
Meshuda, that had been transferred to Moroccan ownership while being blockaded at Gibraltar, while trying to run the blockade into Tripoli. After and joined her,
John Adams engaged a flotilla of enemy gunboats off Tripoli on 22 May sending them scurrying back into the harbor to safety. Five days later—with the added support of , a sister frigate also named for President John Adams—the squadron again exchanged fire with group of Tripolitan forts and
gunboats. One of the most important victories of the war came on 21 June when
John Adams and
Enterprise captured a 22-gun vessel belonging to Tripoli, thus weakening that state sufficiently to allow the squadron to turn its attention to
Tunis,
Algiers, and
Morocco, which were threatening U.S. commerce in the Western
Mediterranean. Throughout the summer and early fall
John Adams operated in that quarter before returning home with New York. On 6 October 1803 Capt. High Campbell took command. At the end of the brief war between the U. S. And Morocco, that had been started by the Governor of Tangier without permission of the Emperor of Morocco, Meshuda was returned to the Emperor of Morocco on 19 October 1803. On 19 October she sailed for home. She arrived at the Washington Navy Yard on 11 December 1803. In March, 1804 she was fitting out for deployment to the Mediterranean and Lt. Isaac Chauncey was ordered to take command on 8 March the day she was recommissioned. By 24 May 1804 Chauncey had been promoted to Master Commandant. In a letter dated 29 May to Commodore Preble the Secretary of the Navy states that "John Adams' is a stores/provisioning ship and should be constantly used as such unless an operation was about to happen that she could be useful for, but be detained as little as necessary. She departed the Washington Navy Yard on 23 May. She arrived at Hampton Roads on 15 June, departing 25 June. She arrived at Gibraltar on 22 July 1804. Meanwhile, Commodore
Edward Preble, who had led a powerful fleet to the Mediterranean, vigorously pressed the fight. In August and September 1804 he made a series of major attacks on Tripoli. As the second of these blows was being delivered 7 August,
John Adams, now under Captain
Isaac Chauncey, arrived on the scene deeply laden with stores. Her boats participated in a reconnaissance patrol on the night of 18 August, and 6 days later she slipped in close to the city for an intensive 4-hour bombardment. Two nights later during a similar attack, an enemy shot sank one of
John Adamss boats, killing three men and wounding a fourth, as the American Squadron severely punished Tripoli with over 700 well-directed rounds which took effect within the city. After a fifth attack had been successfully completed 3 September, bad weather interrupted operations and
John Adams sailed to
Syracuse with other ships of the squadron. On 8 January 1805 she sailed for the U.S. with Commodore Preble, arriving at New York 26 February 1805. On 6 March 1805 Secretary of the Navy Robert Smith ordered Captain
Isaac Chauncey to make all necessary repairs to quickly prepare her for another Mediterranean voyage and recruitment of seamen for the frigate's third voyage to the Mediterranean, he emphasized, the Navy wanted,"active men who can fight." It is my wish to send to the Mediterranean as many men in the
John Adams as she can conveniently carry thither. I want to send out 500 Men, of which number at least 200 must be Able Seamen. You will begin to recruit as soon as you conveniently can. Enter the men to serve 2 years (although it is probable they will not be kept in the Mediterranean for 2 years) allow Able Seamen $ 12 per month, Ordinary Seamen $ 8, Boys $ 6. Engage healthy, active men who can fight. Allow 2 to 4 months advance on customary security. On 17 March 1805 the Secretary of the Navy gave Chauncey permission to take a requested furlough. Master Commandant John Shaw assumed command at Noon 16 April 1805. On her next Mediterranean supply run, May to November, she transported approximately 500 sailors as replacements for crews whose enlistments had expired or were about to. She escorted a number of gunboats, but they were separated in a storm. She arrived at Gibraltar 15 June 1805. On 30 July she was with the U.S. fleet at Tunis. In service she had been considered a poor sailor; between 1807 and 1809 her
forecastle and
quarterdeck were removed and she was re-rated as (depending on the source) either a corvette or a sloop-of-war. ==War of 1812==