The Royal Navy's newest submarine is sailing from Barrow-in-Furness, Cumbria, to its new base at Faslane on the Clyde.
Ambush cost £1.6bn and is the second Astute class nuclear-powered submarine to be built in Cumbria.
The 7,400 tonne vessel was built by BAE Systems over nine years.
Commanding officer Peter Green said Ambush was to undergo sea trials to "prove this amazing piece of equipment is ready for operations".
Large crowds gathered in Barrow to see the vessel set sail.
She will continue sea testing in the coming months and will formally become HMS Ambush when commissioned into the Royal Navy.
BAE Systems maritime submarines managing director John Hudson paid tribute to everyone who had been involved and said Ambush was "ferociously complicated".
The submarine's sonar system can track ships 3,000 miles (about 4,800km) away.
She will be armed with both Tomahawk land attack missiles and Spearfish torpedoes.