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).