The Northern War, often called the Great Northern War, distributes the coastline of the Baltic among the neighbouring nations in a manner which lasts into the 20th century.

Provoked by Sweden's dominant position, and launched in 1700 by an act of concerted aggression against Sweden by the kings of Poland and Denmark and the tsar of Russia, the war seems at first to give conclusive proof that Sweden fully deserves her pre-eminence in the region. The early Swedish successes are in large part due to the energy and military genius of the young king, Charles XII, eighteen years old in 1700 and three years into his reign.

The concerted attack on Swedish territory during 1700 takes place in three regions. In February the Polish king, Augustus II, moves north to besiege the port of Riga. A month later the Danish king, Frederick IV, marches south into Swedish possessions in Schleswig-Holstein. In August the Russian tsar, Peter the Great, brings an army west to attack the port of Narva.

Charles XII deals with each in turn, scoring rapid hits against his multiple enemies almost in the manner of a lone hero in a western. First, in August 1700, he ferries an army across the water to the island of Sjaelland, landing a few miles from Copenhagen. By the end of the month the Danes have withdrawn from the war.

In October Charles lands with 10,000 men at Pärnu, a point from which he can move south to relieve Riga or east to the defence of Narva. He selects as his first target the Russians besieging Narva. An attack in November on the tsar's fortified encampment, containing 23,000 soldiers, is entirely successful. Peter the Great withdraws from the immediate fray (giving himself a lull which he will use to excellent effect, establishing a naval base in the Gulf of Finland).

Meanwhile Charles is able to give his full attention to the Polish king, Augustus II, who is also the elector of Saxony.

Over the next six years the victories of Charles XII over Augustus the Strong are devastating. The Saxons are driven back across the Daugava river in the summer of 1701, ending their threat to Riga. Charles XII reaches and enters Warsaw in May 1702. He defeats Augustus two months later in a battle further south in Poland, at Kliszow.

In 1704 Charles persuades the Poles to depose Augustus and to elect in his place a Polish noble as Stanislaw I. In 1706 the Swedish king completes the humiliation of Augustus by marching into Saxony to impose a treaty signed at Altranstädt.

By 1707, with Denmark, Saxony and Poland out of the war, Charles XII is free to tackle the major threat to Sweden's dominance of the Baltic. The Russian tsar, Peter the Great, has merely retired wounded in 1700.

Peter has made much of the intervening years. He has founded St Petersburg as a new Russian base on the Baltic, and he has profited from Charles's southern campaigns to move his own armies down the coast. In 1704 he captures Narva, which he failed to take in 1700. When Charles enters Saxony, in 1706, Peter moves a large Russian army down the Baltic coast and across the Polish border.

Sweden and Russia: 1707-1711

In the autumn of 1707 Charles XII moves northeast from Saxony with an army of almost 40,000 men. His intention is to move towards Moscow during the summer of 1708, forcing Peter to withdraw from the Baltic to defend his capital. The plan is frustrated by Peter's strategy of avoiding a pitched battle while devastating the countryside between the advancing Swedish army and Moscow. By the autumn of 1708 Charles XII is forced to turn south into the Ukraine in search of food.

The winter of 1708-9 is unusually cold even for these inhospitable regions. It is a much reduced Swedish army, of some 18,000 men, which finally comes to grips with the Russians in July 1709 at Poltava.

The engagement is the first major disaster in Charles's brilliant military career. With almost the whole Swedish army either captured or killed, Charles himself escapes south into Turkish territory. He immediately enters negotiations with the Turks, who share his hostility to the Russians and are eager to recover Azov.

Charles summons a new army from Sweden, to provide his share of an anti-Russian alliance with Turkey. It never arrives, but the Turks on their own defeat Peter the Great in 1711 at the Prut river. In the ensuing negotiations Peter agrees to return Azov - and considers himself to have escaped lightly in giving no concessions at all to Sweden, as Turkey's supposed ally.

Final years of the war: 1714-1721

After three years of frustrating diplomacy, Charles XII makes his way back from Turkey to Swedish territory in 1714. With the permission of the Austrian emperor he rides incognito through Habsburg and imperial lands to the Baltic coast in Pomerania, completing the journey in fourteen days.

In his absence Sweden's Baltic empire has been encroached upon on all sides. A peace settlement is clearly now inevitable, but while preparing for it Charles rebuilds Sweden's army. By the autumn of 1718 he has assembled 60,000 men. He is putting them to their first test, in an invasion of Norway, when he is killed by a musket shot.

Peace negotiations continue for three years after the death of Charles XII, and the final terms are a disaster for Sweden compared to the high hopes raised early in the war. Most of the Swedish possessions on the southern coast of the Baltic are now ceded to Prussia and to Hanover. And the commercial advantage of free passage through the Sound for Swedish goods is surrendered.

But the greatest blow is Sweden's loss to Russia. By the treaty of Nystad, in 1721, Peter the Great obtains the east Baltic coast from Vyborg down to Riga (a stretch in which he has already built himself St Petersburg). With these advantages Russia replaces Sweden as the leading power in the Baltic.

Hats and Caps: 1720-1772

The death of the unmarried Charles XII without an heir leaves the Swedish monarchy in as weak a state as the nation. Charles's brother-in-law is elected to the throne in 1720, as Frederick I, but the political effect of the change is to give more power to Sweden's parliament, the riksdag. This ancient institution now evolves along lines similar to the British pattern, with policy contested between organized parties.

Here, the equivalents of Whigs and Tories go by equally strange descriptions. The two parties are the Hats and the Caps. The Hats take their name from military headgear; they believe in an aggressive policy to recover Sweden's empire. The Caps, more peacefully inclined, are named from nightcaps.

At the riksdag of 1738 the Hats become the dominant party, and they hold power until 1765. Their military policy does little good to Sweden, which becomes increasingly subservient to Russia. Their main achievement is progressively to weaken the power of the monarch. Indeed during the reign of Adolphus Frederick, the elected heir of Frederick I, the ruling senate makes use of a stamp duplicating the king's signature to avoid his personal involvement in the nation's business.

Foreign powers attempt to influence Sweden's policy, by paying large subsidies to help either the Hats or Caps into power. The bribing of Sweden's political parties becomes part of a wider European conflict.

France supports the Hats, hoping to win the alliance of a militant Sweden. France's enemies (in particular Britain, Prussia and Russia) subsidise the Caps with the intention of keeping an inert Sweden on the sidelines.

The two squabbling and corrupt factions damage Sweden both at home and abroad. The situation is not resolved until Gustavus III succeeds his father Adolphus Frederick in 1771. He is as forceful as his father was feeble. In a coup d'état of 1772 he persuades the Stockholm garrison to arrest all the members of the ruling council of state. He then presents the riksdag with a new constitution bringing executive power back into royal hands. It is unanimously accepted.

Gustavus III: 1772-1792

Gustavus, ending half a century of chaotic parliamentary government, uses very effectively the power which he has reclaimed for the throne. He is a ruler of his own time - the enlightened despot, cultured, a generous patron of the arts (and himself a dramatist), well-meaning, eager to be strong in causes which he believes to be right.

The legal system is reformed, torture is abolished, religious toleration is introduced, as also is freedom of the press. Steps are taken to soften the impact of the poor laws and to improve trade and the national finances.

In such measures Gustavus is following policies very similar to those of contemporaries such as the emperor Joseph II. But unlike other European rulers of the period, Gustavus has acquired his power at the expense of a political class which has become accustomed to having its own way. The nobility are particularly affronted by his actions. On a dramatic occasion the king falls victim to their grievances.

On 16 March 1792 Gustavus goes to a midnight masquerade in Stockholm's opera house. During it an officer, a member of a conspiracy, shoots him in the back - a sensational event which Verdi later dramatizes in his opera Un Ballo in Maschera (A Masked Ball).

Gustavus IV: 1792-1809

The assassination of the king brings to the throne his 13-year-old son as Gustavus IV. After a regency of only four years, he takes power into his own hands in 1796 - at a time when all European nations are confronting the threat posed by a revolutionary and expansionist France.

Gustavus at first attempts to preserve Swedish neutrality, joining in 1800 the short-lived League of Armed Neutrality (Sweden withdraws in May 1801, a month after Nelson's destruction of the Danish fleet at Copenhagen). By 1805 Gustavus's sentiments have turned against Napoleon. In that year he joins Britain, Russia and Austria in the Third Coalition.

Gustavus remains an ally of Britain for longer than any other nation in the Third Coalition, and in doing so harms Sweden's interests. The Russian tsar, changing sides to become an ally of Napoleon at Tilsit in 1807, has designs upon Sweden's valuable province of Finland.

When France and Russia together demand that Sweden join them in war against Britain, Gustavus refuses to do so. Russia immediately invades Finland, in February 1808. The Swedes mount a campaign in defence of their frontier, and during 1808 Swedish and Finnish forces win several minor victories. But by the end of the year the Swedes are forced to abandon the region.

By now there is so little support in Sweden for Gustavus that a coup against him by army officers, in March 1809, meets no resistance. Gustavus is seized in his royal apartments and is soon deported, with his immediate family, to Germany (he lives in exile until his death in 1837).

The crown is offered by the riksdag to Gustavus's uncle, as Charles XIII, on condition that he accepts a new constitution. He does so, but his election as monarch brings an immediate further problem. He is sixty-one and childless. The riksdag's first choice as his heir is a Danish prince, but the young man dies in 1810. The next choice is bold and surprising.

Sweden is now an ally of France, having made peace in January 1810. One of Napoleon's marshals has impressed Swedish observers by his administration of Baltic coastal regions and by his humane treatment of Swedish prisoners. He is Jean Bernadotte, son of a French lawyer, linked by marriage to Napoleon's family, and in 1806 created prince of the tiny Italian state of Pontecorvo.

Bernadotte recognizes an interesting new career opportunity when he is offered, in August 1810, the position of Swedish crown prince

Charles XIV: 1810-1844

Bernadotte arrives in Sweden in October 1810, having adopted the Lutheran faith and a pair of Swedish names - Carl Johan. The existing king is feeble and often ill, so from the start Bernadotte acts in effect as regent. For the next two years Sweden remains a passive ally of France against Britain. But in 1812 Bernadotte makes a bold decision. It shows him willing to place new loyalties above old, and capable of a shrewd assessment of his new country's best interests.

The hope in Sweden is that he will recover Finland from Russia. Instead, he reasons that Norway is a more desirable acquisition. And with France and Russia at war again from 1812, he sees a way of achieving his end.

Denmark, the kingdom to which Norway is attached, is like Sweden an ally of France. Bernadotte resolves to change sides - a course of action made diplomatically easier when Napoleon, in January 1812, seizes Sweden's province of Pomerania on the southern shore of the Baltic.

Bernadotte makes an alliance first with Russia, in April 1812, and then in March and April 1813 with Britain and Prussia. He even receives a British subsidy for his planned attack on Denmark. The allies insist on his bringing a Swedish army to join the great campaign against Napoleon in the summer of 1813. But after the victory at Leipzig, in October, Bernadotte is free to turn his attention to his intended target.

He marches into the southern Danish province of Holstein and before the end of the year forces Denmark's submission. In the treaty of Kiel, in January 1814, he achieves his purpose. Norway is ceded to Sweden. It requires a subsequent invasion of Norway to ensure local acceptance of this change, but by the end of 1814 the king of Sweden (still Charles XIII) is also king of Norway.

Charles XIII dies in 1818 and Bernadotte becomes king of both nations with the official title of Charles XIV John.

The adventurer who has won his first chances during the French Revolution proves a somewhat reactionary monarch. But by the time he dies, as a grand old man of eighty-one in 1844, he is a popular figure in Sweden. And the Bernadotte dynasty from France is still, at the end of the 20th century, the Swedish royal family.

During the 19th century their founder's greatest achievement, the winning of Norway, presents many problems. Ruling two neighbouring kingdoms, officially equal and independent, is a difficult balancing act. It becomes, until 1905, the main political theme in both Norway and Sweden.

Norway and Sweden: 1814-1905

Both Norway and Sweden benefit from a 19th century which is free of wars. They can concentrate instead on developing their substantial natural resources. Industry is established, railways are built, and in Sweden the Göta canal is completed in 1832 - enabling sea-going ships to cross the entire peninsula, over a distance of some 300 miles, from Göteborg to a point south of Stockholm in the Baltic.

But politically the attention of both countries is focused, above all, on the problems resulting from the union of the two crowns.

The Swedes, more numerous than the Norwegians, with a long and often glorious history as an independent kingdom, are convinced that they are the senior partner. They view Norway almost as a neighbouring colony, acquired by conquest.

The Norwegians, in contrast, have it in writing that they are equal and independent - in the terms agreed in 1814. Moreover the constitution which they devised for themselves in that year includes a storting, or parliament, based on a franchise broad for its time. All peasants owning their land, or renting it for more than five years, have a vote. The storting is able to provide an articulate expression of popular resentment against any sign of Swedish hegemony.

The grounds for complaint are numerous. The shared king lives mainly in Sweden and is represented by a viceroy in Norway. The very existence of this office is offensive. To make matters worse, it is occupied until 1829 by a Swede.

Offence derives also from other issues of the kind which invariably inflame nationalist sensiblities - what design of flag is to be flown on ships of the two kingdoms, what is to be the first language of documents, is the ruler to be described as the king of Sweden and Norway or of Norway and Sweden?

The Bernadotte monarchs themselves (Oscar I, 1844-59; Charles XV, 1859-72; Oscar II, 1872-1905) are eager to soothe ruffled Norwegian feelings on most of these issues. But they often find their wishes frustrated by a strong nationalist reaction in Sweden.

Diplomatic representation is the issue which provokes the final crisis. It has always been accepted that foreign affairs are the king's personal responsibility, but one result of this is that diplomats representing the two kingdoms have usually been Swedish - and foreign ministers invariably so.

During the 1890s Norwegian demands for equal representation in diplomacy gradually evolve into a campaign for a separate Norwegian consular service. In March 1905 the Norwegian storting passes a bill unilaterally establishing such a service. When Oscar II refuses to sanction the bill, the storting responds with another dissolving the union with Sweden.

Many in Sweden urge strong action against the rebels, but the king - with the support of liberals in the riksdag - proposes a referendum on the issue in Norway. The result is 368,208 votes in favour of ending the union, and only 184 against. In October 1905 Oscar II relinquishes the crown of Norway.