The Treaty of Roskilde was signed on February 26, 1658 in the Danish city of Roskilde. After a devastating defeat in the Northern Wars (1655-1661), the King of Denmark-Norway was forced to give up nearly half his territory to save the rest. The treaty's conditions included:
Although Sweden also invaded Romsdal, Norway the farmers there defied the Swedish taxes and military conscription vigorously, and the Swedish governor was forced to send a full company of soldiers, and 50 cavalry besides, to collect taxes. The occupation was not successful.
Meanwhile Norwegian forces succeeded expelling the Swedish occupiers from Trøndelag. Eventually, the resulting Treaty of Copenhagen in 1660 restored Trøndelag to Norway, and also the island of Bornholm to Denmark. The island of Anholt off the coast of Halland, was technically never ceded, and thus remained in Dano-Norwegian possession.
In the 1658 Treaty of Roskilde, Denmark ceded the Trondheim region of Norway to Sweden, down to the north bank of the Romsdalfjord. Following the attack on Copenhagen and the city's successful defence, and the reconquest by Norwegian forces of Trondheim, the Treaty of Copenhagen in 1660 restored that province to Norway. The reversion of Trøndelag in the Treaty reflects strong local resistance to the Swedish occupation. Although the Swedish invasion was initially welcomed, or at least not resisted, the Swedes issued conscription orders in Trøndelag and forced 2000 men and young boys down to 15 years of age to join the Swedish wars against Poland and Brandenburg. King Karl X Gustav was afraid that the Trønders would rise against their Swedish occupants, and thought it wise to keep a large part of the men away. Only about one third of the men ever returned to their homes, some of them were forced to settle in the Swedish province of Estonia, as the Swedes thought it would be easier to rule the Trønders there, divide and rule. Trøndelag had already a major part of its men in the Dano-Norwegian army, so the Swedish forced conscription, in fact emptied Trøndelag of males. The result was devastating, as the farms now were left without enough hands to harvest the fields, and famine struck the region. Some local historians of Trøndelag have termed this genocide of the Trønders.
The few months of experience with Swedish taxation and conscription left such a bitter taste that it strengthened Dano-Norwegian unity and patriotism, making resistance to Swedish invasions of Denmark-Norway stronger over the next 80 years.
According to the ninth article of the Treaty of Roskilde, which ceded Skåne, the inhabitants of the Scanian lands were assured of their privileges, old laws and customs. Yet, the process of Swedification was soon initiated in a brutal way. This old paragraph is still referred to by a subset of Scanians demanding regional independence and recognition.