Battle of Nesjar (Slaget ved Nesjar) was a sea battle off the coast of Norway in 1016. It was a primary event in the reign of King Olav Haraldsson (later Saint Olav). Icelandic skald and court poet Sigvatr Þórðarson composed the poem Nesjavísur in memory of the battle.
Tradition places the location of the battle in west end of Oslofjord. The exact location is unknown, but it is somewhere in today's Langesundfjorden inlet in Frierfjord near Brunlanes, Larvik in Vestfold. The fighting parties were the throne claimant Olav Haraldsson on one side and an alliance backing the Swedish vassal Sveinn Hákonarson on the other.
After the defeat of Olav Tryggvason at the Battle of Svolder, Norway had been divided into a Swedish part governed by Sveinn Hákonarson and a Danish part run by Eiríkr Hákonarson. However, after Eiríkr joined his brother-in-law Canute the Great in his campaign to conquer England, Danish rule folded, and power was assumed by Olav Haraldsson, a throne claimant from the Harald Fairhair family line.
Sveinn, who was based in Trøndelag, learned that Olav was rallying support in Eastern Norway. He set sail along the coast of Norway. Along the way he joined forces with those of several allies among Norway's farmer-chieftains. The most prominent of these was Erling Skjalgsson.