|• Total||5 km2 (2 sq mi)|
|• Density||198/km2 (510/sq mi)|
|Time zone||EET (UTC+2)|
|• Summer (DST)||EEST (UTC+3)|
Ainaži (pronounced [aiːnaʒi]; Estonian: Heinaste, German: Haynasch) is a harbour town in the Vidzeme region of Latvia. The town is located near the Estonian border on the site of an ancient Liv fishing village. Before 1917, it was known by its German name Haynasch (in Estonian Heinaste, in Russian, Гайнаш Gainash).
"Ainaži " may be derived from the Estonian word hainaste meaning "hay-road". Other possibilities include the Livonian words aaina meaning "hay", or ainagi meaning "lonely". In the Middle Ages, the town was in German as Haynasch.
Ainaži existed for centuries as a Livonian fishing village. The town itself was first mentioned in 1564, and through the ages, changed hands among various barons and estates. Ainaži entered a great period of growth in the 1870s, when its history of shipbuilding and seafaring began.
In the 19th century, Vidzeme and Courland were covered with vast forests of pine trees. Ainaži's strategic position on the sea and proximity to lumber made it a perfect place for ship building. In 1864 Krišjānis Valdemārs sponsored the first nautical school in Livonia (today Latvia), training young Estonian and Latvian farmers to become ship captains for free. The school stood for 50 years until it was destroyed in World War I. With the opening of the school and shipbuilding industry, Ainaži grew for the rest of the 19th century. From 1857 to 1913, over 50 seaworthy vessels were built in the town, and in 1902 a working port and railway station opened. By World War I, Ainaži was the fourth largest port in all of Latvia and chief in Vidzeme, overtaking neighboring Salacgrīva. The town also had its own windmills, fish-processing plant, and brick kiln.
In World War I Ainaži was heavily damaged. The port was ruined and the entire shipping fleet destroyed. In February 1919, the Estonian army drove the Germans from Ainaži and subsequently occupied it. After the war, Ainaži fell into Latvian territory, even though the majority of the population was Estonian, but Estonia's troops remained stationed there until 1920 and Estonia kept the northern section of the town, the Ikla village.
In the years of independent Republic of Latvia (1918–1940) Ainaži was revitalized. The Ainaži fleet, sunken in the war, had completely barricaded the harbor and had to be removed. The harbor was then deepened, and the port was rebuilt in 1923 with new breakers. In 1930 the Ainaži lighthouse was built.
In World War II, however, Ainaži was destroyed again. The second naval academy burned down, the port was bombed, and the warehouses were plundered. Though the port was partially rebuilt in Soviet times, Ainaži was overshadowed by nearby Pärnu, and lost its fish-processing factory to Salacgrīva.
After Latvia's independence was restored in 1991, a wind turbine was built in Ainaži as well as a customs house on the Estonian border. Today the building of the nautical school hosts a museum, the Ainažu Jūrskolas Muzejs, dedicated to the history of the school and the tradition of shipbuilding along the Vidzeme coast.
The most important industries are forestry, woodworking and trade. In addition, its location at the Latvia-Estonia border on the Via Baltica international highway favours transit/transport industries.
The population of Ainaži and the surrounding area in 2005 was 1794 people, the smallest official town of Vidzeme. Latvians made up 92% of the inhabitants, Russians 3%, Estonians 2%, and others 4%. From 2004 the population had decreased by 5.08% (96 inhabitants).
Latvijas Pilsetas. Riga, Latvia: Preses Nams, 1999. 34-37.