Much of international law is consent-based governance. This means that a state member is not obliged to abide by this type of international law, unless it has expressly consented to a particular course of conduct. This is an issue of state sovereignty. However, other aspects of international law are not consent-based but still are obligatory upon state and non-state actors such as customary international law and peremptory norms (jus cogens).
The current order of international law, the equality of sovereignty between nations, was formed through the conclusion of the "Peace of Westphalia" in 1648. Prior to 1648, on the basis of the purpose of war or the legitimacy of war, it sought to distinguish whether the war was a "just war" or not. This theory of power interruptions can also be found in the writings of the Roman Cicero and the writings of St. Augustine. According to the theory of armistice, the nation that caused unwarranted war could not enjoy the right to obtain or conquer trophies that were legitimate at the time
The 17th, 18th and 19th centuries saw the growth of the concept of the sovereign "nation-state", which consisted of a nation controlled by a centralised system of government. The concept of nationalism became increasingly important as people began to see themselves as citizens of a particular nation with a distinct national identity. Until the mid-19th century, relations between nation-states were dictated by treaty, agreements to behave in a certain way towards another state, unenforceable except by force, and not binding except as matters of honor and faithfulness. But treaties alone became increasingly toothless and wars became increasingly destructive, most markedly towards civilians, and civilised peoples decried their horrors, leading to calls for regulation of the acts of states, especially in times of war.
The modern study of international law starts in the early 19th century, but its origins go back at least to the 16th century, and Alberico Gentili, Francisco de Vitoria and Hugo Grotius, the "fathers of international law." Several legal systems developed in Europe, including the codified systems of continental European states and English common law, based on decisions by judges and not by written codes. Other areas developed differing legal systems, with the Chinese legal tradition dating back more than four thousand years, although at the end of the 19th century, there was still no written code for civil proceedings.
One of the first instruments of modern international law was the Lieber Code, passed in 1863 by the Congress of the United States, to govern the conduct of US forces during the United States Civil War and considered to be the first written recitation of the rules and articles of war, adhered to by all civilised nations, the precursor of international law. This led to the first prosecution for war crimes—in the case of United States prisoners of war held in cruel and depraved conditions at Andersonville, Georgia, in which the Confederate commandant of that camp was tried and hanged, the only Confederate soldier to be punished by death in the aftermath of the entire Civil War.