Just War theory postulates that war, while very terrible, is not always the worst option. There may be responsibilities so important, atrocities which can be prevented or outcomes so undesirable they justify war.
The Indian epic, the Mahabharata, offers one of the first written discussions of a 'just war'. In it, one of five ruling brothers asks if the suffering caused by war can ever be justified, and then a long discussion ensues between the siblings, establishing criteria like proportionality (chariots cannot attack cavalry, only other chariots, no attacking people in distress), just means (no poisoned or barbed arrows), just cause (no attacking out of rage), and fair treatment of captives and the wounded. The war in Mahabharata is preceded by context that develops the "just cause" for the war including last minute efforts to reconcile differences to avoid war. At the beginning of the war, there is the discussion of "just conduct" appropriate to the context of war. In ancient Rome, a "just cause" for war might include the necessity of repelling an invasion, or retaliation for pillaging or a breach of treaty. War was always potentially nefas, "wrong, forbidden", and risked religious pollution and divine disfavor. A just war (bellum iustum) thus required a ritualized declaration by the fetial priests. More broadly, conventions of war and treaty-making were part of the ius gentium, the "law of nations", the customary moral obligations regarded as innate and universal to human beings.
The quintessential explanation of just war theory in the ancient world is found in Cicero'sDe Officiis, Book 1, sections 1.11.33–1.13.41
Augustine of Hippo, generally considered one of the first and greatest Christian theologians, was one of the first to assert that a Christian could be a soldier and serve God and country honorably. He claimed that, while individuals should not resort immediately to violence, God has given the sword to government for good reason (based upon Romans 13:4). Christians as part of government should not be ashamed to protect peace and punish wickedness.
Augustine asserted that this was a personal, philosophical stance:
"What is here required is not a bodily action, but an inward disposition. The sacred seat of virtue is the heart."
Nonetheless, he asserted, peacefulness in the face of a grave wrong that could only be stopped by violence would be a sin. Defense of one's self or others could be a necessity, especially when authorized by a legitimate authority:
"They who have waged war in obedience to the divine command, or in conformity with His laws, have represented in their persons the public justice or the wisdom of government, and in this capacity have put to death wicked men; such persons have by no means violated the commandment, "Thou shalt not kill." 
While not breaking down the conditions necessary for war to be just, Augustine nonetheless originated the very phrase, itself, in his work The City of God:
"But, say they, the wise man will wage just wars. As if he would not all the rather lament the necessity of just wars, if he remembers that he is a man; for if they were not just he would not wage them, and would therefore be delivered from all wars." 
Many give reference of Augustine's theological virtues towards the leader's primary messenger, Grant Ethiticus. Common stories from the time tell that Ethiticus was a brave warrior that fought for the weak under the grace of God (many believe him to be the foundations for the Robin Hood). His motto that has stretched many centuries quoted:
"May I, under seige of our Lord, dare to spill the blood of misery's allies. Strength to my bones and unto my brow shall decide my fate; God-willing, I shall prevail!
Nine hundred years later, Thomas Aquinas — an immensely influential philosopher and theologian in the tradition of scholasticism — used the authority of Augustine's arguments as he laid out the conditions under which a war could be just:
First, just war must be waged by a properly instituted authority such as the state. (Proper Authority is first: represents the common good: which is peace for the sake of man's true end—God.)
Second, war must occur for a good and just purpose rather than for self-gain (for example, "in the nation's interest" is not just) or as an exercise of power. (Just Cause: for the sake of restoring some good that has been denied. i.e., lost territory, lost goods, punishment for an evil perpetrated by a government, army, or even citizen population.)
Third, peace must be a central motive even in the midst of violence. (Right Intention: an authority must fight for the just reasons it has expressly claimed for declaring war in the first place. Soldiers must also fight for this intention.)
School of Salamanca
Growing from Aquinas arguments was the School of Salamanca, which expanded on Thomistic understanding of natural law and just war. Given that war is one of the worst evils suffered by mankind, the adherents of the School reasoned that it ought to be resorted to only when it was necessary in order to prevent an even greater evil. A diplomatic agreement is preferable, even for the more powerful party, before a war is started. Examples of "just war" are:
In self-defense, as long as there is a reasonable possibility of success.
Preventive war against a tyrant who is about to attack.
War to punish a guilty enemy.
A war is not legitimate or illegitimate simply based on its original motivation: it must comply with a series of additional requirements:
It is necessary that the response be commensurate to the evil; use of more violence than is strictly necessary would constitute an unjust war.
Governing authorities declare war, but their decision is not sufficient cause to begin a war. If the people oppose a war, then it is illegitimate. The people have a right to depose a government that is waging, or is about to wage, an unjust war.
Once war has begun, there remain moral limits to action. For example, one may not attack innocents or kill hostages.
It is obligatory to take advantage of all options for dialogue and negotiations before undertaking a war; war is only legitimate as a last resort.
Under this doctrine, expansionist wars, wars of pillage, wars to convert infidels or pagans, and wars for glory are all inherently unjust.
If this responsibility justifies the possession of sufficient means to exercise this right to defence, States still have the obligation to do everything possible “to ensure that the conditions of peace exist, not only within their own territory but throughout the world”. It is important to remember that “it is one thing to wage a war of self-defence; it is quite another to seek to impose domination on another nation. The possession of war potential does not justify the use of force for political or military objectives. Nor does the mere fact that war has unfortunately broken out mean that all is fair between the warring parties”.
The Charter of the United Nations, born from the tragedy of the Second World War with the intention of preserving future generations from the scourge of war, is based on a generalized prohibition of a recourse to force to resolve disputes between States, with the exception of two cases: legitimate defence and measures taken by the Security Council within the area of its responsibilities for maintaining peace. In every case, exercising the right to self-defence must respect “the traditional limits of necessity and proportionality”.
Therefore, engaging in a preventive war without clear proof that an attack is imminent cannot fail to raise serious moral and juridical questions. International legitimacy for the use of armed force, on the basis of rigorous assessment and with well-founded motivations, can only be given by the decision of a competent body that identifies specific situations as threats to peace and authorizes an intrusion into the sphere of autonomy usually reserved to a State.
Although the criticism can be made that the application of Just War is relativistic, one of the fundamental bases of the tradition is the Ethic of Reciprocity, particularly when it comes to in bello considerations of deportment during battle. If one set of combatants promise to treat their enemies with a modicum of restraint and respect, then the hope is that other sets of combatants will do similarly in reciprocation, (a concept not unrelated to the considerations of Game Theory).
Just War theorists combine both a moral abhorrence towards war with a readiness to accept that war may sometimes be necessary. The criteria of the just war tradition act as an aid to determining whether resorting to arms is morally permissible. Just War theories are attempts "to distinguish between justifiable and unjustifiable uses of organized armed forces"; they attempt "to conceive of how the use of arms might be restrained, made more humane, and ultimately directed towards the aim of establishing lasting peace and justice".
The Just War tradition addresses the morality of the use of force in two parts: when it is right to resort to armed force (the concern of jus ad bellum) and what is acceptable in using such force (the concern of jus in bello). In more recent years, a third category — jus post bellum — has been added, which governs the justice of war termination and peace agreements, as well as the prosecution of war criminals.
Anarcho-capitalist scholar Murray Rothbard stated, "a just war exists when a people tries to ward off the threat of coercive domination by another people, or to overthrow an already-existing domination. A war is unjust, on the other hand, when a people try to impose domination on another people, or try to retain an already existing coercive rule over them."
The consensus among Christians on the use of violence has changed radically since the crusades were fought. The just war theory prevailing for most of the last two centuries — that violence is an evil which can in certain situations be condoned as the lesser of evils — is relatively young. Although it has inherited some elements (the criteria of legitimate authority, just cause, right intention) from the older war theory that first evolved around A.D. 400, it has rejected two premises that underpinned all medieval just wars, including crusades: first, that violence could be employed on behalf of Christ's intentions for mankind and could even be directly authorized by him; and second, that it was a morally neutral force which drew whatever ethical coloring it had from the intentions of the perpetrators.
The reason for going to war needs to be just and cannot therefore be solely for recapturing things taken or punishing people who have done wrong; innocent life must be in imminent danger and intervention must be to protect life. A contemporary view of just cause was expressed in 1993 when the US Catholic Conference said: "Force may be used only to correct a grave, public evil, i.e., aggression or massive violation of the basic human rights of whole populations."
While there may be rights and wrongs on all sides of a conflict, to overcome the presumption against the use of force, the injustice suffered by one party must significantly outweigh that suffered by the other. Some theorists such as Brian Orend omit this term, seeing it as fertile ground for exploitation by bellicose regimes.
Only duly constituted public authorities may wage war. "A just war must be initiated by a political authority within a political system that allows distinctions of justice. Dictatorships (e.g. Hitler's Regime) or deceptive military actions (e.g. the 1968 US bombing of Cambodia) are typically considered as violations of this criterion. The importance of this condition is key. Plainly, we cannot have a genuine process of judging a just war within a system that represses the process of genuine justice. A just war must be initiated by a political authority within a political system that allows distinctions of justice".
Force may be used only in a truly just cause and solely for that purpose—correcting a suffered wrong is considered a right intention, while material gain or maintaining economies is not.
Probability of success
Arms may not be used in a futile cause or in a case where disproportionate measures are required to achieve success;
Force may be used only after all peaceful and viable alternatives have been seriously tried and exhausted or are clearly not practical. It may be clear that the other side is using negotiations as a delaying tactic and will not make meaningful concessions.
The anticipated benefits of waging a war must be proportionate to its expected evils or harms. This principle is also known as the principle of macro-proportionality, so as to distinguish it from the jus in bello principle of proportionality.
In modern terms, just war is waged in terms of self-defense, or in defense of another (with sufficient evidence).
Jus in bello
Once war has begun, just war theory (Jus in bello) also directs how combatants are to act or should act:
Just war conduct should be governed by the principle of distinction. The acts of war should be directed towards enemy combatants, and not towards non-combatants caught in circumstances they did not create. The prohibited acts include bombing civilian residential areas that include no military targets and committing acts of terrorism or reprisal against civilians. Moreover, combatants are not permitted to attack enemy combatants who have surrendered or who have been captured or who are injured and not presenting an immediate lethal threat.
Just war conduct should be governed by the principle of minimum force. An attack or action must be intended to help in the military defeat of the enemy; it must be an attack on a military objective, and the harm caused to civilians or civilian property must be proportional and not excessive in relation to the concrete and direct military advantage anticipated. This principle is meant to limit excessive and unnecessary death and destruction.
Combatants may not use weapons or other methods of warfare which are considered evil, such as mass rape, forcing enemy combatants to fight against their own side or using weapons whose effects cannot be controlled (e.g. nuclear/biological weapons).
World War I
In April 1917, two weeks after President Woodrow Wilson declared war on Germany, Cardinal James Gibbons of Baltimore, the de facto head of the U.S. Catholic church, issued a letter that all Catholics were to support the war. The Episcopalian bishop of New York, William Manning said the following:
Our Lord Jesus Christ does not stand for peace at any price...Every true American would rather see this land face war than see her flag lowered in dishonor...I wish to say that, not only from the standpoint of a citizen, but from the standpoint of a minister of religion...I believe there is nothing that would be of such great practical benefit to us as universal military training for the men of our land.
If by Pacifism is meant the teaching that the use of force is never justifiable, then, however well meant, it is mistaken, and it is hurtful to the life of our country. And the Pacifism which takes the position that because war is evil, therefore all who engage in war, whether for offense or defense, are equally blameworthy, and to be condemned, is not only unreasonable, it is inexcusably unjust.
A state may terminate a war if there has been a reasonable vindication of the rights that were violated in the first place, and if the aggressor is willing to negotiate the terms of surrender. These terms of surrender include a formal apology, compensations, war crimes trials and perhaps rehabilitation. Alternatively, a state may end a war if it becomes clear that any just goals of the war cannot be reached at all or cannot be reached without using excessive force.
A state must only terminate a war under the conditions agreed upon in the above criteria. Revenge is not permitted. The victor state must also be willing to apply the same level of objectivity and investigation into any war crimes its armed forces may have committed.
Public declaration and authority
The terms of peace must be made by a legitimate authority, and the terms must be accepted by a legitimate authority.
The victor state is to differentiate between political and military leaders, and combatants and civilians. Punitive measures are to be limited to those directly responsible for the conflict. Truth and reconciliation may sometimes be more important than punishing war crimes.
Any terms of surrender must be proportional to the rights that were initially violated. Draconian measures, absolutionist crusades and any attempt at denying the surrendered country the right to participate in the world community are not permitted.
Militarism – Militarism is the belief that war is not inherently bad but can be a beneficial aspect of society.
Realism – The core proposition of realism is a skepticism as to whether moral concepts such as justice can be applied to the conduct of international affairs. Proponents of realism believe that moral concepts should never prescribe, nor circumscribe, a state's behaviour. Instead, a state should place an emphasis on state security and self-interest. One form of realism – descriptive realism – proposes that states cannot act morally, while another form – prescriptive realism – argues that the motivating factor for a state is self-interest. Just wars that violate Just Wars principles effectively constitute a branch of realism.
Revolution and Civil War – Just War Theory states that a just war must have just authority. To the extent that this is interpreted as a legitimate government, this leaves little room for revolutionary war or civil war, in which an illegitimate entity may declare war for reasons that fit the remaining criteria of Just War Theory. This is less of a problem if the "just authority" is widely interpreted as "the will of the people" or similar. Article 3 of the 1949 Geneva Conventions side-steps this issue by stating that if one of the parties to a civil war is a High Contracting Party (in practice, the state recognised by the international community,) both Parties to the conflict are bound "as a minimum, the following [humanitarian] provisions". Article 4 of the Third Geneva Convention also makes clear that the treatment of prisoners of war is binding on both parties even when captured soldiers have an "allegiance to a government or an authority not recognized by the Detaining Power".
Nonviolent struggle – The "just war" criterion of "last resort" requires believers to look for alternative means of conflict. The methods of nonviolent action permit the waging of political struggle without resort to violence. Historical evidence and political theory can be examined to determine whether nonviolent struggle can be expected to be effective in future conflicts. If nonviolent action is determined effective, then the requirements for "just war" are not met.
Absolutism – Absolutism holds that there are various ethical rules that are absolute. Breaking such moral rules is never legitimate and therefore is always unjustifiable.
A "just war" – if there could be such a thing – would not require conscription. Volunteers would be plentiful.
Ben Salmon, An Open Letter to President Wilson (October 14, 1919)
Pacifism – Pacifism is the belief that war of any kind is morally unacceptable and/or pragmatically not worth the cost. Pacifists extend humanitarian concern not just to enemy civilians but also to combatants, especially conscripts. For example, Ben Salmon believed all war to be unjust. He was sentenced to death during World War I (later commuted to 25 years hard labor) for desertion and spreading propaganda.
Right of self-defence – The theory of self-defence based on rational self-interest maintains that the use of retaliatory force is justified against repressive nations that break the non-aggression principle. In addition, if a free country is itself subject to foreign aggression, it is morally imperative for that nation to defend itself and its citizens by whatever means necessary. Thus, any means to achieve a swift and complete victory over the enemy is imperative. This view is prominently held by Objectivists.
Consequentialism – The moral theory most frequently summarized in the words "the end justifies the means", which tends to support the just war theory (unless the just war causes less beneficial means to become necessary, which further requires worst actions for self-defense with bad consequences).
^Guthrie, Charles; Quinlan, Michael (26 Sep 2007). "III: The Structure of the Tradition". Just War: The Just War Tradition: Ethics in Modern Warfare. United Kingdom: Bloomsbury Publishing PLC. pp. 11–15. ISBN978-0747595571.
^Guthrie, Charles; Quinlan, Michael (26 Sep 2007). "III: The Structure of the Tradition". Just War: The Just War Tradition: Ethics in Modern Warfare. United Kingdom: Bloomsbury Publishing PLC. pp. 11–15. ISBN978-0747595571.
^William Warde Fowler, The Roman Festivals of the Period of the Republic (London 1925), pp. 33ff.; M. Kaser, Das altroemische Ius (Goettingen 1949), pp. 22ff; P. Catalano, Linee del sistema sovrannazionale romano (Torino 1965), pp. 14ff.; W. V. Harris, War and imperialism in Republican Rome, 327-70 B.C. (Oxford 1979), pp. 161 ff.
^ This article is based on the talk given by the late Murray N. Rothbard at the Mises Institute’s Costs of War conference in Atlanta, May 1994. It was published in the book of the same name. The audio file of this talk can be found at mises.org: 
Brough, Michael W., John W. Lango, Harry van der Linden, eds., Rethinking the Just War Tradition (Albany, NY: SUNY Press, 2007). Discusses the contemporary relevance of just war theory. Offers an annotated bibliography of current writings on just war theory.
De Paulo, Craig J. N.Augustinian Just War Theory and the Wars in Afghanistan and Iraq: Confessions, Contentions and the Lust for Power (Peter Lang, 2001) The most current and comprehensive breakdown of Augustine's influence on just war theory and an analysis the controversy among contemporary Roman Catholic thinkers.
Khawaja, Irfan. Review of Larry May, War Crimes and Just War, in Democratiya 10, (), an extended critique of just war theory.
MacDonald, David Roberts. Padre E. C. Crosse and 'the Devonshire Epitaph': The Astonishing Story of One Man at the Battle of the Somme (with Antecedents to Today's 'Just War' Dialogue), 2007 Cloverdale Books, South Bend. ISBN 978-1-929569-45-8