War of 1812Matthew Perry was the son of Navy Captain Christopher R. Perry and the younger brother of Oliver Hazard Perry. Matthew Perry received a midshipman's commission in the Navy in 1809, and was initially assigned to the USS Revenge, under the command of his elder brother.
Commodore Perry's early career saw him assigned to several ships, including the USS President, which had been in a victorious engagement over a British vessel, HMS Little Belt, shortly before the War of 1812 was officially declared. Aboard the USS President he served as aide to Commodore John Rodgers. He transferred to the USS United States, and saw little fighting in the war after that, since the ship was trapped in port at New London, Connecticut. Following the signing of the Treaty of Ghent which ended the conflict, he served on various vessels in the Mediterranean. Perry served under Commodore William Bainbridge during the Second Barbary War. He then served in African waters aboard USS Cyane during its patrol off Liberia from 1819-1820. After that cruise, Perry was sent to suppress piracy and the slave trade in the West Indies. Later during this period, while in port in Russia, Perry was offered a commission in the Imperial Russian Navy, which he declined.
Perry commanded the USS Shark, a schooner with 12 guns, from 1821-1825. In 1763, when Britain possessed Florida, the Spanish contended that the Florida Keys were part of Cuba and North Havana. Certain elements within the United States felt that Key West (which was then named Cayo Hueso, meaning "Bone Key") could potentially be the "Gibraltar of the West" because it guarded the northern edge of the 90 mile (145&_160;km) wide Straits of Florida -- the deep water route between the Atlantic and the Gulf of Mexico.