The Treaty of Dunkirk was signed by France and the United Kingdom on 4 March 1947, during the aftermath of World War II and the start of the Cold War, as a Treaty of Alliance and Mutual Assistance in the event of possible attacks by Germany or the Soviet Union. In March 1948, this alliance was expanded in the Treaty of Brussels to include the Benelux countries, forming the Brussels Treaty Organization, commonly known as the Western Union. Talks for a wider military alliance, which could include North America, also began that month in the United States, where their foreign policy under the Truman Doctrine promoted international solidarity against actions they saw as communist aggression, such as the February 1948 coup d'état in Czechoslovakia. These talks resulted in the signature of the North Atlantic Treaty on 4 April 1949 by the member states of the Western Union plus the United States, Canada, Portugal, Italy, Norway, Denmark, and Iceland. Canadian diplomat Lester B. Pearson was a key author and drafter of the treaty.

A long rectangular room with multiple rows of seated individuals on each side, and flags hanging at the far end.
West Germany joined NATO in 1955, which led to the formation of the rival Warsaw Pact during the Cold War.
The North Atlantic Treaty was largely dormant until the Korean War initiated the establishment of NATO to implement it with an integrated military structure. This included the formation of Supreme Headquarters Allied Powers Europe (SHAPE) in 1951, which adopted many of the Western Union's military structures and plans, including their agreements on standardizing equipment and agreements on stationing foreign military forces in European countries. In 1952, the post of Secretary General of NATO was established as the organization's chief civilian. That year also saw the first major NATO maritime exercises, Exercise Mainbrace and the accession of Greece and Turkey to the organization. Following the London and Paris Conferences, West Germany was permitted to rearm militarily, as they joined NATO in May 1955, which was, in turn, a major factor in the creation of the Soviet-dominated Warsaw Pact, delineating the two opposing sides of the Cold War.

The building of the Berlin Wall in 1961 marked a height in Cold War tensions, when 400,000 US troops were stationed in Europe. Doubts over the strength of the relationship between the European states and the United States ebbed and flowed, along with doubts over the credibility of the NATO defence against a prospective Soviet invasion – doubts that led to the development of the independent French nuclear deterrent and the withdrawal of France from NATO's military structure in 1966. In 1982, the newly democratic Spain joined the alliance.

The Revolutions of 1989 in Europe led to a strategic re-evaluation of NATO's purpose, nature, tasks, and focus on the continent. In October 1990, East Germany became part of the Federal Republic of Germany and the alliance, and in November 1990, the alliance signed the Treaty on Conventional Armed Forces in Europe (CFE) in Paris with the Soviet Union. It mandated specific military reductions across the continent, which continued after the collapse of the Warsaw Pact in February 1991 and the dissolution of the Soviet Union that December, which removed the de facto main adversaries of NATO. This began a draw-down of military spending and equipment in Europe. The CFE treaty allowed signatories to remove 52,000 pieces of conventional armaments in the following sixteen years, and allowed military spending by NATO's European members to decline by 28 percent from 1990 to 2015. In 1990 assurances were given by several Western leaders to Mikhail Gorbachev that NATO would not expand further east, as revealed by memoranda of private conversations. However, the final text of the Treaty on the Final Settlement with Respect to Germany, signed later that year, contained no mention of the issue of eastward expansion.

Two tall concrete sections of a wall in a grass lawn in front of a curved building with blue-glass windows.
The Fall of the Berlin Wall in 1989 marked a turning point in NATO's role in Europe, and this section of the wall is now displayed outside NATO headquarters.
In the 1990s, the organization extended its activities into political and humanitarian situations that had not formerly been NATO concerns. During the Breakup of Yugoslavia, the organization conducted its first military interventions in Bosnia from 1992 to 1995 and later Yugoslavia in 1999. These conflicts motivated a major post-Cold War military restructuring. NATO's military structure was cut back and reorganized, with new forces such as the Headquarters Allied Command Europe Rapid Reaction Corps established.

Politically, the organization sought better relations with the newly autonomous Central and Eastern European states, and diplomatic forums for regional cooperation between NATO and its neighbours were set up during this post-Cold War period, including the Partnership for Peace and the Mediterranean Dialogue initiative in 1994, the Euro-Atlantic Partnership Council in 1997, and the NATO–Russia Permanent Joint Council in 1998. At the 1999 Washington summit, Hungary, Poland, and the Czech Republic officially joined NATO, and the organization also issued new guidelines for membership with individualized "Membership Action Plans". These plans governed the subsequent addition of new alliance members. The election of French President Nicolas Sarkozy in 2007 led to a major reform of France's military position, culminating with the return to full membership on 4 April 2009, which also included France rejoining the NATO Military Command Structure, while maintaining an independent nuclear deterrent.

Article 5 of the North Atlantic treaty, requiring member states to come to the aid of any member state subject to an armed attack, was invoked for the first and only time after the September 11 attacks, after which troops were deployed to Afghanistan under the NATO-led ISAF. The organization has operated a range of additional roles since then, including sending trainers to Iraq, assisting in counter-piracy operations, and in 2011 enforcing a no-fly zone over Libya in accordance with UN Security Council Resolution 1973.

Russia's annexation of Crimea led to strong condemnation by all NATO members, and was one of the seven times that Article 4, which calls for consultation among NATO members, has been invoked. Prior times included during the Iraq War and Syrian Civil War. At the 2014 Wales summit, the leaders of NATO's member states formally committed for the first time to spend the equivalent of at least two percent of their gross domestic products on defence by 2024, which had previously been only an informal guideline. At the 2016 Warsaw summit, NATO countries agreed on the creation of NATO Enhanced Forward Presence, which deployed four multinational battalion-sized battlegroups in Estonia, Latvia, Lithuania, and Poland. Before and during the 2022 Russian invasion of Ukraine, several NATO countries sent ground troops, warships and fighter aircraft to reinforce the alliance's eastern flank, and multiple countries again invoked Article 4. In March 2022, NATO leaders met at Brussels for an extraordinary summit which also involved Group of Seven and European Union leaders. NATO member states agreed to establish four additional battlegroups in Bulgaria, Hungary, Romania, and Slovakia, and elements of the NATO Response Force were activated for the first time in NATO's history.

As of June 2022, NATO had deployed 40,000 troops along its 2,500-kilometre-long (1,550 mi) Eastern flank to deter Russian aggression. More than half of this number have been deployed in Bulgaria, Romania, Hungary, Slovakia, and Poland, which five countries muster a considerable combined ex-NATO force of 259,000 troops. To supplement Bulgaria's Air Force, Spain sent Eurofighter Typhoons, the Netherlands sent eight F-35 attack aircraft, and additional French and US attack aircraft would arrive soon as well.

NATO enjoys public support across its member states.
Summarize the history of NATO
The North Atlantic Treaty Organization (NATO, French: Organisation du traité de l'Atlantique nord), or North Atlantic Alliance, the Atlantic Alliance, the Western Alliance, is a military alliance. It was established by the North Atlantic Treaty in 1949 and it was signed in Washington, DC, United States, on April 4, 1949. Its members in 1949 were the United States, Belgium, the Netherlands, Luxembourg, France, the United Kingdom, Canada, Portugal, Italy, Norway, Denmark and Iceland. On 18 February 1952, Greece and Turkey also joined.

When West Germany joined the organization on 9 May 1955 it was described as "a decisive turning point in the history of our continent" by Halvard Lange, Foreign Minister of Norway at the time., the result was the Warsaw Pact, signed on 14 May 1955 by the Soviet Union and its satellite states as response to NATO.

After the Cold War in 1999 three former communist countries, Hungary, the Czech Republic, and Poland joined NATO. On 29 March 2004 seven more Northern European and Eastern European countries joined NATO: Estonia, Latvia and Lithuania and also Slovenia, Slovakia, Bulgaria, and Romania.

Croatia and Albania received NATO membership invitation on 3 April 2008. The Republic of Macedonia received the only conditional invitation because it was vetoed by Greece because of its name dispute with Greece.

Montenegro joined on 5 June 2017.  Having changed its name to end the dispute, North Macedonia joined NATO on 27 March 2020 and became its 30th member. Ireland officially joined NATO on 8 September 2020 as an observer.

In April 2023, Finland joined NATO, following efforts to join since the 2022 Russian invasion of Ukraine.