She saw action during the Boxer Uprising in Qing China in 1900, contributing a landing party to the force that captured the Taku Forts and the subsequent Seymour Expedition.
The experience of Japanese cruisers during the contemporaneous First Sino-Japanese War showed the benefit of larger 21 cm (8.3 in) guns, which were adopted for the main battery of the Victoria Louise class.
[5] Hansa was ordered under the contract name "N" and was laid down at the AG Vulcan shipyard in Stettin on 23 July 1896, though some initial assembly of material had begun in workshops on 27 April.
During her initial working up period on 6 June, she accidentally ran aground in the Great Belt due to heavy fog.
She stopped in the Levant from 31 August to 4 September to deliver gifts from Kaiser Wilhelm II to holy sites in Jerusalem and Haifa.
The ship then passed through the Suez Canal, the Red Sea, and into the Indian Ocean, before stopping in the Maldives to conduct a hydrographic survey of the islands.
Hansa stopped in Colombo, British Ceylon, on 29 September for a rest period for the engine room personnel, who had become overworked dealing with repeated breakdowns on the way.
At one point in the Indian Ocean, all three engines and the electric generators had failed, forcing the crew to deploy sea anchors for several hours while repairs were carried out.
Hansa replaced the elderly Deutschland as the deputy commander's flagship, and Konteradmiral (KAdm—Rear Admiral) Ernst Fritze came aboard the ship on the 4th.
Prince Heinrich departed with Deutschland for Germany on 4 January 1900, leaving Fritze in command of the unit aboard Hansa until VAdm Felix von Bendemann arrived 17 February, who made Hertha his flagship.
After a cruise south to Singapore, Hansa arrived in Qingdao in Germany's Jiaozhou Bay Leased Territory in China on 15 March.
Fritze left for Germany as well on 8 April, and his replacement, KAdm Hermann Kirchhoff arrived aboard Hansa in mid-July.
The ship arrived off the Taku Forts on 7 June, where she joined an international fleet led by the British Vice Admiral Edward Seymour.
Hansa contributed a landing party of 123 men led by the ship's executive officer, (Captain Lieutenant) Paul Schlieper, to the Seymour Expedition.
In the course of operations, Hansa's crew had suffered thirteen dead and twenty-four wounded, the heaviest casualties of any German warship involved in the conflict.
While she was there, KAdm Hunold von Ahlefeld replaced Kirchhoff as the squadron deputy commander and FK Adolf Paschen relieved Pohl.
The ship got underway on 31 March and sailed via Singapore and Batavia, Dutch East Indies, and Fremantle, Australia, before arriving in Melbourne on 1 May.
Hansa then cruised briefly with the gunboat Möwe, then in use as a survey ship, before departing on 24 May to return to Tsingtao, by way of Matupi Harbor, New Britain, and Manila in the Philippines.
That month, Hansa entered the Yangtze and steamed as far upriver as Nanking, where she took part in the funeral ceremony for the viceroy of Guangxi Province.
Hansa made another voyage up the Yangtze to Nanking in March 1903, where Baudissin transferred to the gunboat Luchs, which carried him further to Hankou.
[16] After the outbreak of the Russo-Japanese War the following month, Hansa went to evacuate German nationals from Seoul, Korea, and Port Arthur and Dalian on the Liaodong Peninsula and took them to Qingdao.
[14] In early March, she was again in Hong Kong, and was joined there by the flagship of the East Asia Squadron, the armored cruiser Fürst Bismarck on the 8th.
On 13 August, the Russian ships restocked their coal supplies from three British steamers, but Hansa and Fürst Bismarck cleared for action to prevent them from leaving the port.
[20] KAdm Heinrich von Moltke arrived to replace Holtzendorff as the deputy commander on 16 December, though Hansa was no longer a flagship, as the position of 2nd Admiral had already been abolished on 27 July.
The refit was finished by 1 April 1909, at which point Hansa was recommissioned for service as a training ship for naval cadets and apprentice seamen.
For the next few months, Hansa cruised in German waters and the western Baltic Sea with a contingent of trainees, before making a visit to Norway.
After another repair period, she began another voyage on 4 June in the Baltic, visiting Karlskrona, Sweden, and St. Petersburg, Russia, from 3 to 15 July.
After making short training voyages in home waters in mid-1913, Hansa began what would be her final overseas cruise on 11 August, this time to the Mediterranean.
There, she became the flagship of KAdm Gisberth Jasper, who had been given command of the newly formed V Scouting Group, which included her three sister ships Victoria Louise, Vineta, and Hertha.
Following Germany's defeat in November 1918, Hansa was stricken from the naval register on 6 December 1919 and sold to ship breakers in Audorf-Rendsburg.