The sloop along with the squadron then sailed to Tripoli and Tunis to demand indemnities for pirated prizes and continued operating in protection of American shipping interests until departing for home, arriving at New York in early 1817.
[6][7] On 4 October the Ontario, under the command of Captain James Biddle sailed to the Pacific station on a pioneer mission, stopping at Rio de Janeiro, to deliver dispatches.
The Chilean War of Independence at this time was in full swing and a Spanish blockade of Valparaíso had been declared, with American merchantmen ships being seized.
Through diplomatic negotiations with authorities at that port, Captain Biddle succeeded in achieving the release of captured U.S. ships, and then departed north, arriving off Cape Disappointment on the Columbia River on 19 August.
Ontario sailed for home that fall, stopping at Valparaíso en route in time to witness the start of Lord Cochrane's campaign at sea against Spain, and stood into Chesapeake Bay finally on 23 April 1819.