In 1799, Spencer was promoted to the rank of lieutenant. He was commissioned into , a 100-gun ship of the line. However, she blew up in an accident before he could join her. He joined the 80-gun , one of the few French ships to escape Nelson at the Battle of the Nile. She had, however, subsequently been captured. She was then renamed . He then joined the sloop , as lieutenant to the captain. This vessel supported the campaign to oust Napoleon's troops from Egypt.