HMS Sceptre, one of Britain's fleet of nuclear-powered submarines, has arrived home to its Faslane base on the Clyde after nine months at sea.
Many of the 116 crew have been with the vessel for the full duty.
The Royal Navy said HMS Sceptre's arrival marked the end of one of the longest patrols in submarine history.
This deployment has taken the Swiftsure class submarine to the Gulf and South Africa. The vessel can produce its own fresh water, oxygen and electricity.
It is also equipped with torpedoes and Tomahawk cruise missiles.
Built by Vickers in Barrow-in-Furness, HMS Sceptre was launched more than 30 years ago and was the fourth 'S'-class submarine to enter service with the Royal Navy.
Captain Richard Baum, captain of submarines at the Clyde naval base, said: "The living conditions on these boats are tight, to say the least, tolerable but not comfortable.
"A nine-month deployment is something that probably only another submariner could appreciate."
He said that praise must also go to the vessel, which he described as "a remarkable piece of engineering".
"Believe me, to keep a submarine at sea for nine months is no mean feat," he said.
"She might look a bit tired and weary when she comes in but then she has travelled the equivalent distance of circumnavigating the globe during her deployment."