In 1707 Karl moved the army against Russia. His support systems didn't really work and the Russian army burned stores as they retreated, so the Swedes soon gave up the attempt on Moscow and turned southeast to Ukraine. There, in june 1709, the Swedish army suffered a serious defeat at Poltava. Thousands of Swedish soldiers became prisoners, but the king and some others managed to flee to the Ottoman empire, where Karl then stayed until 1714. By then most of the Swedish empire had been lost to enemies - Russia held the Baltic provinces and Finland, German states had taken the Swedish possesions there.
In 1718 a new army was organised and made an attempt to conquer Norway from Denmark. In november, while inspecting trenches outside a Norwegian castle, the king was shot in the head and died immediately. His uniform from the occasion can be seen in the Royal Armoury, the coat and boots still muddy from the trench.