The second USS Ontario was a three-masted, wooden-hulled sloop of war in the United States Navy, bearing 16 guns, and saw service during and following the years of the War of 1812 and in the Second Barbary War. Ontario was built by Thomas Kemp, Baltimore, Maryland, in 1813; blockaded in Chesapeake Bay through the War of 1812; and sailed from New York for the Mediterranean on 20 May 1815, Master Commandant Jesse D. Elliott in command. Second Barbary War Ontario arrived at Gibraltar on 15 June 1815 and joined Commodore Stephen Decatur's ten ship squadron sent there to put a stop to the piracy of the Barbary states of Tripoli and Algiers that had plagued the Mediterranean for many years. Present in the fleet was the frigates and and sloop , the latter being used to sail home with the signed treaty. Ontario then began serving in the blockade off Algiers and continued through June when the Dey of Algiers finally and reluctantly agreed to sign a peace with Decatur. 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. Pacific 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 sloop then sailed around Cape Horn and proceeded to Valparaíso, Chile, in early 1818. 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. There the ship claimed both sides of the river for the United States and next sailed south, touching at Monterey, California, for supplies, becoming the first American naval vessel to visit the three future Pacific coast states. 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. Mediterranean Squadron On 18 January 1821, Ontario departed New York harbor on her next