After escaping, Gregory was appointed a midshipman on January 16, 1809, by President Jefferson and reported to the Revenge, commanded by Oliver Hazard Perry.
In 1811, while serving in the Vesuvius and as acting captain of Gun Boat 162, Gregory participated in three notable actions.
In the morning, Gregory spotted a British vessel called the Black Snaked manned by 20 Royal Marines and Canadian militia.
At Gregory’s signal, the Americans jumped the Black Snake and captured all 20 British marines and Canadian militia.
The Black Snake sank rapidly and slowed the British who were distracted into salvaging the sunken vessel as the American raiders escaped.
[1][2] In Gregory’s next maritime guerrilla operation, he and his raiders were ordered to sabotage and destroy a British schooner that was under construction and being built for 14 guns.
Gregory placed scouts at the edge of nearby homes and sent the rest of his force under the schooner to set fire combustibles.
In 1824, Gregory fitted out the frigate Brandywine, destined to carry the Marquis de la Fayette back to France.
In 1826 Gregory sailed a 64-gun frigate named HELLAS from Christopher Bergh's shipyard in New York City's lower East Side to Greece for the revolutionary government.
From 1824 to 1828 Gregory served at the New York Navy Yard, and in 1831 reported to the Pacific Station for a three-year cruise in command of Falmouth.
From the Pacific Ocean, Gregory—appointed a Captain in 1838—sailed to the Gulf of Mexico, where he commanded North Carolina and Raritan and served in the blockade of the Mexican coast during the Mexican–American War.
He had been placed under "house arrest" at a country estate, where he lived by a gentleman's agreement not to attempt escape by passing beyond certain boundaries, one of which was defined by a large stone marker.
At some point, there was a formal dinner party at another estate a mile or so away that the captain wished to attend, yet was beyond the set boundary.
The dinner guests were surprised during the party by the arrival of the American captain, and he was accused of violating the terms of his incarceration by going beyond the marker.
The captain smilingly ushered the complainants outside...where they found a wheelbarrow parked at the far corner of the house containing the large marker stone.
Admiral Gregory was married to Elizabeth, daughter of Captain John Shaw, an early naval commander and a hero of the 1st Barbary Coast campaign and the War of 1812.