Air warfare must comply with laws and customs of war, including international humanitarian law by protecting the victims of the conflict and refraining from attacks on protected persons.

These restraints on aerial warfare are covered by the general laws of war, because unlike war on land and at sea—which are specifically covered by rules such as the 1907 Hague Convention and Protocol I additional to the Geneva Conventions, which contain pertinent restrictions, prohibitions and guidelines—there are no treaties specific to aerial warfare.

To be legal, aerial operations must comply with the principles of humanitarian law: military necessity, distinction, and proportionality: 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 protected civilians or civilian property must be proportionate and not excessive in relation to the concrete and direct military advantage anticipated.

International law up to 1945 Before and during World War II (1939–1945), international law relating to aerial bombardment rested on the treaties of 1864, 1899, and 1907, which constituted the definition of most of the laws of war at that time – which, despite repeated diplomatic attempts, was not updated in the immediate run-up to World War II. The most relevant of these treaties is the Hague Convention of 1907 because it was the last treaty ratified before 1939 which specified the laws of war regarding the use of bombardment. In the Hague Convention of 1907, two treaties have a direct bearing on the issue of bombardment. These are "Laws of War: Laws and Customs of War on Land (Hague IV); 18 October 1907"Laws of War: Laws and Customs of War on Land (Hague IV); 18 October 1907 available from the Avalon Project at the Yale Law School, entered into force: 26 January 1910. and "Laws of War: Bombardment by Naval Forces in Time of War (Hague IX); 18 October 1907".Laws of War: Bombardment by Naval Forces in Time of War (Hague IX); October 18, 1907, available from the Avalon Project at the Yale Law School, It is significant that there is a different treaty which should be invoked for bombardment of land by land (Hague IV) and of land by sea (Hague IX).International Review of the Red Cross no 323 cites: Charles Rousseau, References p. 360. "the analogy between land and aerial bombardment". Hague IV, which reaffirmed and updated Hague II (1899),Laws of War: Laws and Customs of War on Land (Hague II); July 29, 1899, available from the Avalon Project at the Yale Law School, entry into force 4 September 1900 contains the following clauses:

Although the 1907 Hague Conventions IV – The Laws and Customs of War on Land and IX – Bombardment by Naval Forces in Time of War prohibited the bombardment of undefended places, there was no international prohibition against indiscriminate bombardment of non-combatants in defended places, a shortcoming in the rules that was greatly exacerbated by aerial bombardment.

The attendees of the Second Hague Conference in 1907 did adopt a "Declaration Prohibiting the Discharge of Projectiles and Explosives from Balloons" on 18 October 1907. It stated: "The Contracting Powers agree to prohibit, for a period extending to the close of the Third Peace Conference, the discharge of projectiles and explosives from balloons or by other new methods of a similar nature.""Declaration (XIV) Prohibiting the Discharge of Projectiles and Explosives from Balloons". The Hague, 18 October 1907. The foreshadowed "Third Peace Conference" never took place, and the Declaration remains in force. The United Kingdom and the United States ratified the Declaration.

With the rise of aerial warfare, non-combatants became extremely vulnerable and inevitably became collateral targets in such warfare – potentially on a much larger scale than previously.

World War I (1914-1918) saw the first use of strategic bombing when German Zeppelins and aircraft indiscriminately dropped bombs on cities in Britain and France. These nations, fighting against Germany and its allies in the war, retaliated with their own air-raids (see Strategic bombing during World War I). A few years after World War I, a draft convention was proposed in 1923: The Hague Rules of Air Warfare.The Hague Rules of Air Warfare, December 1922 – February 1923. The draft contained a number of articles which would have directly affected how militaries used aerial bombardment and defended against it: articles 18, 22 and 24. The law was, however, never adopted in legally binding formRules concerning the Control of Wireless Telegraphy in Time of War and Air Warfare, from the International Committee of the Red Cross's section on international humanitarian law verified 26 February 2005 as all major powers criticized it as being unrealistic.

The Greco-German arbitration tribunal of 1927–1930 arguably established the subordination of the law of air warfare to the law of ground warfare. It found that the 1907 Hague Convention on "The Laws and Customs of War on Land" applied to the German attacks in Greece during World War I:"Laws of War: Laws and Customs of War on Land (Hague IV); October 18, 1907". Avalon Project, Yale Law School. Entered into force 26 January 1910 This concerned both Article 25 and Article 26.

Jefferson Reynolds in an article in The Air Force Law Review argues that "if international law is not enforced, persistent violations can conceivably be adopted as customary practice, permitting conduct that was once prohibited."Jefferson D. Reynolds. "Collateral Damage on the 21st century battlefield: Enemy exploitation of the law of armed conflict, and the struggle for a moral high ground". Air Force Law Review. Volume 56, 2005 (PDF). p. 57/58. Even if the Greco-German arbitration tribunal findings had established the rules for aerial bombardment, by 1945, the belligerents of World War II had ignored the preliminary bombardment procedures that the Greco-German arbitration tribunal had recognized.

The German and Italian bombings of Guernica and Durango in Spain in 1937 during the Spanish Civil War of 1936–1939 and the Japanese aerial attacks on crowded Chinese cities during the Second Sino-Japanese War in 1937–38 attracted worldwide condemnation, prompting the League of Nations to pass a resolution"Protection of Civilian Populations Against Bombing From the Air in Case of War". Unanimous resolution of the League of Nations Assembly, 30 September 1938. Accessed 26 February 2005 that called for the protection of civilian populations against bombardment from the air. In response to the resolution passed by the League of Nations, a draft convention in Amsterdam of 1938"Draft Convention for the Protection of Civilian Populations Against New Engines of War". Amsterdam, 1938. Accessed 26 February 2005 would have provided specific definitions of what constituted an "undefended" town, excessive civilian casualties and appropriate warning. This draft convention makes the standard of being undefended quite high – any military units or anti-aircraft within the radius qualifies a town as defended. This convention, like the 1923 draft, was not ratified – nor even close to ratification – when hostilities broke out in Europe in 1939. While the two conventions offer a guideline to what the belligerent powers were considering before the war, neither of these documents came to be legally binding.

At the start of World War II in 1939, following an appeal by Franklin D. Roosevelt, President of the then neutral United States, the major European powers, including Britain and Germany, agreed not to bomb civilian targets outside combat zones: Britain agreeing provided that the other powers also refrained (see the policy on strategic bombing at the start of the World War II). However, this was not honored, as belligerents of both sides in the war adopted a policy of indiscriminate bombing of enemy cities. Throughout World War II, cities like Chongqing, Warsaw, Rotterdam, London, Coventry, Stalingrad, Hamburg, Dresden, Tokyo, Hiroshima, and Nagasaki suffered aerial bombardment, causing untold numbers of destroyed buildings and the deaths of tens of thousands of civilians.

After World War II, the massive destruction of non-combatant targets inflicted during the war prompted the victorious Allies to address the issue when developing the Nuremberg Charter of August 1945 to establish the procedures and laws for conducting the Nuremberg trials (1945–1946). Article 6(b) of the Charter thus condemned the "wanton destruction of cities, towns or villages, or devastation not justified by military necessity" and classified it as a violation of the laws or customs of war, therefore, making it a war crime. This provision was similarly used at the Tokyo Trials of 1946–1948 to try Japanese military and civilian leaders in accordance with the Tokyo Charter (January 1946) for illegal conducts committed during the Pacific War of 1941–1945. However, due to the absence of positive or specific customary international humanitarian law prohibiting illegal conducts of aerial warfare in World War II, the indiscriminate bombing of enemy cities was excluded from the category of war crimes at the Nuremberg and Tokyo Trials, therefore, no Axis officers and leaders were prosecuted for authorizing this practice. Furthermore, the United Nations War Crimes Commission received no notice of records of trial concerning the illegal conduct of air warfare. Chris Jochnick and Roger Normand in their article The Legitimation of Violence 1: A Critical History of the Laws of War explain that: "By leaving out morale bombing and other attacks on civilians unchallenged, the Tribunal conferred legal legitimacy on such practices."