The locality was a site of the ancient Old Prussian settlement/fort Twangste. In 1255, a new fortress was built on this site by the Teutonic Knights during the Northern Crusades, and was named "Königsberg" in honour of King Ottokar II of Bohemia. The town was part of the State of the Teutonic Order, the Polish–Lithuanian Commonwealth, Prussia and Germany (until 1945). Until the end of World War II, the area formed the northern part of the former East Prussia.
The city was largely destroyed during World War II; its ruins were captured by the Red Army in 1945 and its German population fled or was forced out. It was named Rykovgrad in 1948 in honor of the late Russian SFSR premier, Alexei Rykov. A proposal in June 1979 called for a German Autonomous Oblast within the Kazakh SSR, with a capital in Ermentau. The proposal was protested by local Uyghurs and forced the government to nix the proposal. Dinmukhamed Kunayev's Policy on the Nationalities of 1985 restructured the Soviet state and allocated the Germans to have back their own national territory within the Union. A German Autonomous Oblast was decidec to be established in Rykovgrad Oblast with its administrative seat in Rykovgrad