She was known to the KM as HSK 5(II) (i.e., the second of that designation; the first was Pinguin), or also as Schiff 5. She was not given a raider letter by the Royal Navy as she did not enter active service as a commerce raider. The last German vessel to be converted into an auxiliary cruiser, the Hansa was named after the Hanseatic League.
Hansa was originally conceived as the cargo ship Glengarry. She was taken over by the Germans during the occupation of Denmark, while under construction at Burmeister & Wain in Copenhagen. She was temporary renamed Zielschiff Meersburg and served as a target ship for the 27th U-boat flotilla.
In the winter of 1942–43, she was sent to the Wilton shipyard in Rotterdam, and later to Blohm & Voss, Hamburg, where she was converted into an auxiliary cruiser. She bore the designation HSK 5(II), reflecting the number of the ship yard she was converted in.
De-commissioned as a Hilfskreuzer in February 1944 the ship became a Kadettenschulschiff (cadet training ship).
From September 1944 to May 1945 she participated in the Baltic Sea evacuations, transporting over 12,000 soldiers and civilians at a time. The Hansa was the last ship, which escaped from Hel.
On 20 May 1945 she sailed off to internment to Fehmarn. She was taken over by the British and returned to the Glen Line, part of the Alfred Holt Group (Blue Funnel Line), who had originally ordered her. She sailed under different names until 1971, but mostly as Glengarry. She was scrapped in 1971. Two of her sister ships were converted into troop landing ships and were present at Anzio and Salerno. These also survived the war and were taken back into service by the Alfred Holt Group.