The de facto Swedish ruler, crown prince Charles John, acting on behalf of king Charles XIII, rejected the premise of an independent Norway and launched a military campaign on July 2, 1814 with an attack on the Hvaler islands and the city of Fredrikstad. The Swedish army was superior in numbers, was better equipped and trained, and was led by one of Napoleon's foremost generals, the newly elected Swedish crown prince, Charles John — Jean Baptiste Bernadotte.

The hostilities opened on 26 July with a swift Swedish naval attack against the Norwegian gunboats at Hvaler. The Norwegian vessels managed to escape, but they did not take part in the rest of the war. The main Swedish thrust came across the border at Halden, bypassing and surrounding the fortress of Fredriksten, and then continuing north, while a second force of 6,000 soldiers landed at Kråkerøy outside of Fredrikstad. This town surrendered the next day. This was the start of a pincer movement around the main part of the Norwegian army at Rakkestad. The Norwegian army delivered several offensive blows to the Swedes, thus applying pressure on the Swedes to accept Norway as a sovereign nation, and opening up negotiations. The tactic worked; when talks began on 7 August, Charles John accepted the democratic Norwegian constitution. Armistice negotiations concluded at Moss on August 14, 1814.

The Treaty of Kiel was thus tacitly subdued and a new union on more equal terms negotiated. The convention comprised four documents, all written in French, with the following main points:

The agreement was entered into between the Swedish crown prince on behalf of the Swedish king, and the Norwegian government. The Swedes did not recognize Christian Frederik's claim to the Norwegian throne, so he was not officially a party to the agreement, which was negotiated and signed by two of his ministers, Niels Aall and Jonas Collett. (Though a secret agreement was also executed ordering him to return to Denmark).

The Norwegian parliament was to convene by the end of September, or the beginning of October, to ratify the convention.

The King of Sweden accepted the Norwegian constitution, with only such amendments as were necessary to accommodate the union with Sweden. All changes were to be accepted by the Norwegian parliament.

Christian Frederik (referred to as "prince") was to abandon all claims to the Norwegian crown and leave the country after having convened the parliament.

The Moss Ironworks main office - where the Convention of Moss was negotiated and signed.

Norwegians were shocked by their government's concessions, and when the Swedish general Magnus Björnstjerna, who had led the Swedish negotiations, arrived in Christiania, Norway, he got an unfriendly welcome. Norwegians also directed their resentment toward their own leaders and what they perceived as spineless military defense. Over time, public opinion shifted. The convention was a significant improvement over the terms dictated to Denmark–Norway at the treaty of Kiel. Notably, Norway was no longer to be treated as a Swedish conquest but rather as an equal party in a union of two independent states. Both the principle and substance of the Norwegian Constitution were accepted, and Norway retained its own parliament and separate institutions, except for the common king and foreign service. This was the last war between Sweden and Norway, and Sweden's last war.