Sweden had to encounter many enemies after the battle of Fehrbellin, and a chain of disasters followed, nearly crushing the young king under their weight. Holland, Austria, Brandenburg and Denmark attacked the Swedish possessions, which were all captured, one after the other. Charles was not able to send reinforcements, the navy being in a miserable condition, and when rejuvenated, through strenuous effort, defeated by the excellent admirals Juel, of the Danish, and Tromp, of the Dutch, navy. The treasury was empty, the administration in disorder, and mistrust and strife reigned supreme. But the young king showed that he wanted to be obeyed, and managed, by hard work, to establish order, the Riksdag sacrificing means to organize the defence.
The Danes were successful in their first expeditions on land also, their army having undergone a reorganization. King Christian V. marched into Scania, while his general, Gyldenlœve, invaded Bohuslæn and West Gothland. The hostile fleets captured the islands of Œland and Gothland. Charles XI., in a sinister state of mind verging on despair, at last had his army collected, and entered Halland, where Danish troops were encountered and defeated at Halmstad. This gave courage to the Swedes, who soon thought themselves invincible, when commanded by the young king himself. Charles received reinforcements through peasant troops, and was desirous to meet Christian in open battle. But the Danish army in Scania retreated until forced to meet the enemy near Lund. Here a bloody and decisive battle was fought, more than 8,000 men being killed, and resulting in a victory for the Swedes, who took 2,000 prisoners, fifty-one cannon, and the whole hostile camp, December 3, 1676.
In the following year Sweden suffered two defeats at sea, through the hands of Juel, but won another victory on land, at Landskrona, when the Danes lost 3,000 men.
While Charles XI. fought with the courage of despair, Louis XIV. was supremely victorious over his enemies, soon appearing as the dictator of Europe, when peace was made at Nimwegen, in 1679. Finding Charles XI. resolved not to cede any of his territory, King Louis took a similar standpoint in his behalf, but contemptuously neglected to let the Swedish ambassadors take any active part in the deliberations. Louis XIV. made peace with the emperor, Brandenburg and Denmark on behalf of Sweden, which country only ceded a small part of East Pomerania to Brandenburg. Charles XI. deeply felt the insolence of the benevolent dictator, and forced Christian V. to sign a treaty of peace at Lund, in 1680, as if Louis XIV. had no part in it. An agreement was made that Charles XI. should marry the sister of Christian V., the beautiful Ulrica Eleonore. Through her gentleness, piety and great benevolence, she soon acquired fame as one of the noblest queens of Sweden. Ulrica Eleonore led a quiet life, seldom being seen at court, where the vain and despotic queen-dowager held the first place. She was never able to win the affection of her consort until during her last illness. King Charles then, for the first time, understood what a treasure he had held unappreciated at his side, and watched over her with infinite care, bringing peace and sunshine into her last days. After her death, in 1693, the king became a prey to deep sorrow and remorse, which threw added gloom over his dark countenance. The queen had been active in upholding a good relation between the Scandinavian countries, often bitterly opposed by the queen-dowager, in the interests of Holstein.