Ērgļi is a small town in Ērgļi Parish, Madona Municipality in the Vidzeme region of Latvia on the banks of the Ogre river. It serves as the administrative center for Ērgļi Parish. Ērgļi had 2,769 residents as of 2017.
Ērgļi castle on Ogre river was one of the largest castles of Latgale. From 1211 the area belonged to the Order of the Brothers of the Sword and later to the Archdiocese of Riga. The first written mention of a castle was in 1334. After the Livonian War, the area fell to Poland-Lithuania then to Sweden and 1721 to Russia.
The village was built around the estate Erlaa and had in 1931 331 inhabitants. During the Second World War, the village was in the combat zone in 1944 and was completely destroyed. In the postwar period, the place grew by settlement of industry.
Until 2009, the town was the terminus of the Riga-Ērgļi railway. Railway service was provided 9 times a week until October 2007, leaving everyday at about 3.40 and leaving on rest days also at about 13.00, the Railway was then removed.