The ship was built in 1881 as the Socrates-class steamer (and prospectively, the Lima-Class cruiser Callao) Diogenes by the Howaldtswerke at Kiel, Germany. Acquired by the Navy from the Thames Iron Works, London, England, on 2 April 1898, she was renamed Topeka, and placed in commission the same day.
Topeka cleared Falmouth, England, on 19 April 1898 and arrived at Tompkinsville, New York, on 1 May 1898. The following day, she moved to the New York Navy Yard to begin a two-month overhaul during which she received her armament and generally prepared for duty on the Cuban blockade. The gunboat departed New York on 30 June 1898 and, after a five-day stop at Key West, Florida, joined the blockading forces off Havana on 11 July 1898. That same day, she was assigned station off Nipe Bay, located on the northeastern shore of Cuba almost directly opposite Santiago de Cuba on the island's southeastern coast. On 17 July 1898, she and captured the Spanish sloop Domingo Aurelio off Nipe Bay. Four days later, Topeka joined gunboat, armed yacht, and armed tug in a foray into Nipe Bay. The four warships encountered no real resistance from the Spanish and, therefore, easily captured the port and sank the, abandoned by her crew, in the Battle of Nipe Bay.
Following the capture of the Bahia de Nipe littoral, Topeka steamed to Key West with dispatches. She returned to Cuban waters on 28 July and remained until 5 August, when she again steamed to Key West. She made one more voyage to Cuba in mid-August, visiting Port Francis on the 14th before heading north on the 15th. After stops at Key West and Hampton Roads, she visited Provincetown and Boston, Massachusetts, and then arrived at the New York Navy Yard on 13 September. Topeka exited New York Harbor on 22 October and reached Philadelphia the following day. She remained there until 19 November when she sailed for the Caribbean. During that cruise, she visited Cuba, Haiti, San Domingo, and Puerto Rico before returning — via Norfolk, Virginia, and Newport, Rhode Island — to Boston, early in February 1899. On 15 February 1899, Topeka was placed out of commission at the Boston Navy Yard.
After 18 months of inactivity, the gunboat was re-commissioned at Boston on 15 August 1900. She departed Boston on 19 September and, after a five-day stop at Tompkinsville, New York, embarked upon a training cruise to the Mediterranean on 27 September. Steaming via the Azores and Lisbon, Portugal, and Gibraltar, she entered the Mediterranean on 7 November. During the cruise, she visited Villefranche, Genoa, Livorno, Naples, Algiers, and Tangier. Topeka, transited the Strait of Gibraltar on 5 January 1901 and, after visits to the Azores and to St. Vincent and Barbados in the West Indies, returned to the United States at Hampton Roads, Virginia, on 4 March 1901.
For more than a year, Topeka operated along the southeastern coast of the United States and in the West Indies, working out of Norfolk and the South Carolina ports of Charleston and Port Royal. On 16 May 1902, the gunboat cleared Port Royal and headed — via Port-au-Prince, Haiti, and San Juan, Puerto Rico to the Caribbean for a summer training cruise in the waters off Venezuela. Over the next three months, when not conducting gunnery drills, she was a frequent caller at the Venezuelan ports of Puerto Cabello and La Guaira as well as at nearby Curaçao in the Dutch West Indies. She departed Puerto Cabello on 23 August 1902 and reached Hampton Roads on 5 September. That same day, she entered the Norfolk Navy Yard for three months of repairs.
On 10 December, Topeka completed repairs and departed Norfolk to join the fleet in the West Indies. She reached Culebra, Puerto Rico, on the 16th and, for the following two months, conducted exercises in the West Indies and the Caribbean. On 21 February 1903, the ship got underway from Kingston, Jamaica, to return to the United States. She arrived in Charleston, South Carolina, on 1 March, and began operations along the length of the eastern seaboard. Those operations occupied her until late in the year.
On 10 December, she steamed out of Hampton Roads to return south to the Caribbean Sea—Gulf of Mexico area. After a visit to New Orleans, Louisiana, between 16 and 22 December, she began duty with the Caribbean Squadron. In January and early February 1904, she cruised along the coast of Panama in the wake of the revolution which separated that republic from Colombia and paved the way for the construction of the Panama Canal. During the latter part of February, Topeka visited Kingston, Jamaica; Guantanamo Bay, Cuba; and San Juan, Puerto Rico, before joining other units of the fleet off the coast of Dominican Republic late in the month. She plied the waters around Hispaniola through the end of March protecting American lives and interests while civil strife tore the island asunder.
Topeka left the West Indies on 30 March and returned to the United States upon her arrival at Charleston on the 5th. On 15 May, the warship reported for duty at Newport, Rhode Island, and, for the next four months, participated in wireless telegraphy experiments conducted off the New England coast. During October and November, Topeka participated in the trials of three new warships — (Armored Cruiser No. 7), (Armored Cruiser No. 5), and (Armored Cruiser No. 4). Late in November, she resumed duty along the east coast.
On 5 January 1905, Topeka stood out of Newport News, Virginia, to return to the West Indies. She stopped at Key West for 11 days, from 11 to 22 January and then continued on to Cuba. Between 23 and 25 January, the warship gathered hydrographic and commercial information at Havana. She coaled at Bahia de Nipe on the 27th and headed for Puerto Rico, where she trained with the North Atlantic Fleet until 17 February. She operated out of Guantanamo Bay from 19 February to 22 March and then headed back to the United States. After visits in Florida at Key West and Pensacola, Topeka arrived in Hampton Roads on 11 April. On the 23rd, the gunboat again headed south to the troubled waters of the West Indies. She arrived off the Dominican Republic on the 28th and patrolled the coastline of that strife-torn country into August. On 13 August, the gunboat weighed anchor at Guantanamo Bay and shaped a course for Portsmouth, New Hampshire, where she arrived on the 21st. Topeka was placed out of commission on 7 September 1905 and assigned duty as station ship at Portsmouth.
She remained at Portsmouth — serving as station ship, auxiliary to and as a prison ship — until the summer of 1916. On 14 June 1916, she was recommissioned and moved to New York where she served as receiving ship until decommissioned again on 14 September. Two weeks later, she departed New York, under tow by the tug, and returned to Portsmouth. There, she served as a training ship for 1st Naval District recruits throughout the United States' participation in World War I.
On 24 March 1919, Topeka was recommissioned at Boston. After fitting out, she cleared Boston on 28 May and headed south. She arrived in Charleston, South Carolina, on 9 June and reported for duty with the American Patrol Detachment. From then until late October, she cruised the Gulf of Mexico along the coast of Mexico. The gunboat returned to Charleston on 23 October. Topeka was placed out of commission on 21 November 1919 and was turned over to the Commandant of the Charleston Navy Yard. On 17 July 1920, the Navy adopted the alpha-numeric system of hull designations, and the gunboat became PG-35. Almost a year later, on 1 July 1921, she was redesignated IX-35. On 1 July 1922, Topeka was put up for sale. However, no satisfactory bids were forthcoming; and the vessel was withdrawn from the market on 29 September.
Topeka was recommissioned again on 2 July 1923 and was turned over to the 4th Naval District as a training ship for Philadelphia units of the Naval Reserve Forces.
Topeka was decommissioned for the last time on 2 December 1929. On 2 January 1930, her name was struck from the Navy List. In accordance with the terms of the London Treaty for the Limitation and Reduction of Naval Armaments, on 13 May 1930 she was sold for scrapping to the Union Shipbuilding Co., of Baltimore, Maryland. The bell currently sits on the parade deck of the Marine Corps Security Force Company Guantanamo Bay, Cuba and one of her 4-inch guns is mounted in Dahlgren Park in the Washington Navy Yard.