When Albert of Brandenburg-Ansbach in 1525 securalized the monastic state of the Teutonic Knights, Insterburg became part of the Duchy of Prussia and was granted town privileges on 10 October 1583 by the Prussian regent Margrave George Frederick. The town became part of the Kingdom of Prussia in 1701. Because the area had been depopulated by plague in the early 18th century, King Frederick William I of Prussia invited Protestant refugees who had been expelled from the Archbishopric of Salzburg to settle in Insterburg in 1732.
In 1818 after the Napoleonic Wars, the town became the capital of the Insterburg District within the Gumbinnen Region. Michael Andreas Barclay de Tolly died at Insterburg in 1818 on his way from his Livonian manor to Germany, where he wanted to renew his health.
Insterburg became part of the German Empire during the 1871 unification of Germany. On 1 May 1901 it became an independent city separate from the Insterburg District. After World War I, the town was separated from the rest of Weimar Germany, as the province of East Prussia had become an exclave. The football club Yorck Boyen Insterburg was formed in 1921.
During World War II, Insterburg was heavily bombed by the British Royal Air Force on 27 July 1944. The town was stormed by Red Army troops on January 21–22, 1945. With the northern part of East Prussia, Insterburg was transferred from Germany to the Soviet Union after the war according to the Potsdam Conference. Its German population was either evacuated or expelled and replaced with Russians. In 1946 Insterburg was renamed Chernyakhovsk in honor of the Soviet World War II General of the army Ivan Chernyakhovsky, who was killed in the Battle of Königsberg.
After the fall of the Iron Curtain a group of people introduced the Akhal-Teke horse breed to the area and opened an Akhal-Teke breeding stable.