The Battle of Dynekilen forces Sweden to abandon its invasion of Norway.
In 8 July 1716 the Swedish king, Karl XII, raised an army of 20,000 men to meet a planned invasion by Denmark. However, Denmark abondoned the offensive plans and Karl seized the initiative and invaded instead Norway in March 1717 with 8,000 troops. He thought probably he could win an easy victory and use Norway as a bargaining chip with his enemies.
The Swedish king approached the Norwegian capital, then named Kristiania, and occupied the city. When it was clear that the city could not be held, the garrison of Akershus was reinforced and the rest of the Norwegian army withdrew to Lier, southwest of the capital. However, it did not come to a battle since the Norvegians were well prepaired to stop the Swedish army at Gjellebekk, so they turned back before the battle became a large tragedy. Only 39 people lost their life at Gjellebekk.
Norway was at this time in union with Denmark, so invading Norway was political also an attack on Denmark.
Karl concentrated his efforts on breaking through to the the west, but Akershus fortress was too strong to capture, and every road was stoutly held, the people rising en masse to defend their country and cautiously taking the offensive in several small actions. He began his return march to Sweden on 29 April and turned to the equally important task of capturing Fredriksten. This fortress, guarding the southeastern border, was a constant threat to any invader of Norway, and besides, the neighboring city Fredrikshald had a splendid harbor.
After violent fighting Karl captured the city by a surprise attack but had to retreat because the people evacuated it, burning their homes, while the fortress opened fire on the city. He had slight hopes that he might still capture the fortress if his transport fleet lying in Dynekilen, a little inlet a few miles to the south, could reach him with supplies.
The final nail in the invasion coffin was delivered by Norwegian Admiral Peter Wessel Tordenskjold, who on 8 July captured the Swedish supply fleet at the Battle of Dynekil. When the news reached Karl, he broke camp and two days later the last Swedish soldier left Norwegian soil.
In the Autumn of 1718 Karl again attacked Norway. While on an inspection visit to the forward trenches on 30 November, the king was hit in the head by a Norwegian sharpshooter’s round fired from the fortress and was immediately killed.
The Durants write that “he died as he had lived, stupefied with bravery. He was a great general, and won unbelievable victories against great odds; but he loved wars to intoxication, never had victories enough…”