In the century prior to the UN's creation, several international treaty organizations such as the International Committee of the Red Cross were formed to ensure protection and assistance for victims of armed conflict and strife.

In 1914, a political assassination in Sarajevo set off a chain of events that led to the outbreak of World War I. As more and more young men were sent down into the trenches, influential voices in the United States and Britain began calling for the establishment of a permanent international body to maintain peace in the postwar world.

President Woodrow Wilson became a vocal advocate of this concept, and in 1918 he included a sketch of the international body in his 14-point proposal to end the war.

In November 1918, the Central Powers agreed to an armistice to halt the killing in World War I.

Two months later, the Allies met with Germany and Austria-Hungary at Versailles to hammer out formal peace terms.

The League of Nations was approved, and in the summer of 1919, Wilson presented the Treaty of Versailles and the Covenant of the League of Nations to the US Senate for ratification.

On 10 January 1920, the League of Nations formally came into being when the Covenant of the League of Nations, ratified by 42 nations in 1919, took effect.

World War II was broke up.

When war broke out in 1939, the League closed down and its headquarters in Geneva remained empty throughout the war.

The text of the "Declaration by United Nations" was drafted at the White House on 29 December 1941, by President Franklin D. Roosevelt, Prime Minister Winston Churchill, and Roosevelt aide Harry Hopkins. It incorporated Soviet suggestions but left no role for France. "Four Policemen" was coined to refer to four major Allied countries, the United States, the United Kingdom, the Soviet Union, and the Republic of China, which emerged in the Declaration by the United Nations.

"On New Year's Day 1942, President Roosevelt, Prime Minister Churchill, Maxim Litvinov, of the USSR, and T. V. Soong, of China, signed a short document which later came to be known as the United Nations Declaration, and the next day the representatives of twenty-two other nations added their signatures". A JOINT DECLARATION BY THE UNITED STATES OF AMERICA, THE UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND, THE UNION OF SOVIET SOCIALIST REPUBLICS, CHINA, AUSTRALIA, BELGIUM, CANADA, COSTA RICA, CUBA, CZECHOSLOVAKIA, DOMINICAN REPUBLIC, EL SALVADOR, GREECE, GUATEMALA, HAITI, HONDURAS, INDIA, LUXEMBOURG, NETHERLANDS, NEW ZEALAND, NICARAGUA, NORWAY, PANAMA, POLAND, SOUTH AFRICA, YUGOSLAVIA The Governments signatory hereto, Having subscribed to a common program of purposes and principles embodied in the Joint Declaration of the President of the United States of America and the Prime Minister of Great Britain dated August 14, 1941, known as the Atlantic Charter, Being convinced that complete victory over their enemies is essential to defend life, liberty, independence and religious freedom, and to preserve human rights and justice in their own lands as well as in other lands and that they are now engaged in a common struggle against savage and brutal forces seeking to subjugate the world, DECLARE: Each Government pledges itself to employ its full resources, military or economic, against those members of the Tripartite Pact and its adherents with which such government is at war. Each Government pledges itself to cooperate with the Governments signatory hereto and not to make a separate armistice or peace with the enemies. The foregoing declaration may be adhered to by other nations which are, or which may be, rendering material assistance and contributions in the struggle for victory over Hitlerism. The Washington Conference 1941–1942

The UN was formulated and negotiated among the delegations from the Allied Big Four (the United States, the United Kingdom, the Soviet Union, and China) at the Dumbarton Oaks Conference from 21 September 1944 to 7 October 1944 and they agreed on the aims, structure and functioning of the UN.

After months of planning, the UN Conference on International Organization opened in San Francisco, 25 April 1945, attended by 50 governments and a number of non-governmental organizations involved in drafting the UN Charter.

The UN officially came into existence 24 October 1945, upon ratification of the Charter by the five permanent members of the Security Council—France, the Republic of China, the Soviet Union, the UK, and the US—and by a majority of the other 46 signatories.

The UN system is based on five principal organs: the General Assembly, the Security Council, the Economic and Social Council (ECOSOC), the International Court of Justice, and the UN Secretariat. A sixth principal organ, the Trusteeship Council, suspended operations on 1 November 1994, upon the independence of Palau, the last remaining UN trustee territory.

The first meetings of the General Assembly, with 51 nations represented, and the Security Council took place in Methodist Central Hall, Westminster, London beginning on 10 January 1946. Debates began at once covering topical issues including the presence of Russian troops in Iranian Azerbaijan, Great Britain's forces in Greece and within days the first veto was cast.

The final meeting of the League of Nations took place on 18 April 1946 in Geneva.

On 29 November 1947, the General Assembly approved a resolution to partition Palestine, approving the creation of the state of Israel. Two years later, Ralph Bunche, a UN official, negotiated an armistice to the resulting conflict.

The General Assembly selected New York City as the site for the headquarters of the UN, construction began on 14 September 1948 and the facility was completed on 9 October 1952. Its site—like UN headquarters buildings in Geneva, Vienna, and Nairobi—is designated as international territory. The Norwegian Foreign Minister, Trygve Lie, was elected as the first UN Secretary-General.

In 1948, the General Assembly adopted a Universal Declaration of Human Rights, drafted by a committee headed by American diplomat and activist Eleanor Roosevelt, and including the French lawyer René Cassin. The document proclaims basic civil, political, and economic rights common to all human beings, though its effectiveness towards achieving these ends has been disputed since its drafting.

Though the UN's primary mandate was peacekeeping, the division between the US and USSR often paralyzed the organization, generally allowing it to intervene only in conflicts distant from the Cold War. Two notable exceptions were a Security Council resolution on 7 July 1950 authorizing a US-led coalition to repel the North Korean invasion of South Korea, passed in the absence of the USSR, and the signing of the Korean Armistice Agreement on 27 July 1953.

On 7 November 1956, the first UN peacekeeping force was established to end the Suez Crisis; however, the UN was unable to intervene against the USSR's simultaneous invasion of Hungary following that country's revolution.

On 14 July 1960, the UN established United Nations Operation in the Congo (UNOC), the largest military force of its early decades, to bring order to the breakaway State of Katanga, restoring it to the control of the Democratic Republic of the Congo by 11 May 1964.

While traveling to meet rebel leader Moise Tshombe during the conflict, Dag Hammarskjöld, often named as one of the UN's most effective Secretaries-General, died in a plane crash; months later he was posthumously awarded the Nobel Peace Prize.

In 1964, Hammarskjöld's successor, U Thant, deployed the UN Peacekeeping Force in Cyprus, which would become one of the UN's longest-running peacekeeping missions.

With the spread of decolonization in the 1960s, the organization's membership saw an influx of newly independent nations. In 1960 alone, 17 new states joined the UN, 16 of them from Africa. On 25 October 1971, with opposition from the United States, but with the support of many Third World nations, the mainland, communist People's Republic of China was given the Chinese seat on the Security Council in place of the Republic of China that occupied Taiwan; the vote was widely seen as a sign of waning US influence in the organization.

Third World nations organized into the Group of 77 coalition under the leadership of Algeria, which briefly became a dominant power at the UN. On 10 November 1975, a bloc comprising the USSR and Third World nations passed a resolution, over the strenuous US and Israeli opposition, declaring Zionism to be racism; the resolution was repealed on 16 December 1991, shortly after the end of the Cold War.

In 1984, US President Ronald Reagan, withdrew his nation's funding from the United Nations Educational, Scientific, and Cultural Organization (UNESCO) over allegations of mismanagement, followed by the UK and Singapore.

In 1991, the UN authorized a US-led coalition that repulsed the Iraqi invasion of Kuwait.

The UN mission in the Sierra Leone Civil War of 1991–2002 was supplemented by British Royal Marines.

Boutros Boutros-Ghali, Secretary-General from 1992 to 1996, initiated a reform of the Secretariat, reducing the size of the organization somewhat.

The United Nations Commission on Human Rights was formed in 1993 to oversee human rights issues for the UN, following the recommendation of that year's World Conference on Human Rights. Jacques Fomerand, a scholar of the UN, describes this organization's mandate as "broad and vague", with only "meager" resources to carry it out.

In 1994, the UN Assistance Mission for Rwanda failed to intervene in the Rwandan genocide amid indecision in the Security Council.

UN mission to Bosnia faced "worldwide ridicule" for its indecisive and confused mission in the face of ethnic cleansing.

The UN mission in Somalia was widely viewed as a failure after the US withdrawal following casualties in the Battle of Mogadishu.

Kofi Annan (1997–2006), initiated further management reforms in the face of threats from the US to withhold its UN dues.

The Millennium Summit was held in 2000 to discuss the UN's role in the 21st century. The three-day meeting was the largest gathering of world leaders in history and culminated in the adoption by all member states of the Millennium Development Goals (MDGs), a commitment to achieve international development in areas such as poverty reduction, gender equality, and public health. Progress towards these goals, which were to be met by 2015, was ultimately uneven.

The invasion of Afghanistan in 2001 was overseen by NATO.

In 2003, the United States invaded Iraq despite failing to pass a UN Security Council resolution for authorization, prompting a new round of questioning of the organization's effectiveness.

The 2005 World Summit reaffirmed the UN's focus on promoting development, peacekeeping, human rights, and global security.

In 2006, "The United Nations Commission on Human Rights" was replaced by a Human Rights Council consisting of 47 nations.

Under the eighth Secretary-General, Ban Ki-moon, the UN intervened with peacekeepers in crises such as the War in Darfur in Sudan and the Kivu conflict in the Democratic Republic of Congo and sent observers and chemical weapons inspectors to the Syrian Civil War.

In 2010, the organization suffered the worst loss of life in its history, when 101 personnel died in the Haiti earthquake.

In 2013, an internal review of UN actions in the final battles of the Sri Lankan Civil War in 2009 concluded that the organization had suffered "systemic failure".

The Sustainable Development Goals were launched in 2015 to succeed the Millennium Development Goals.

In an effort to enhance transparency, in 2016 the organization held its first public debate between candidates for Secretary-General.

On 1 January 2017, Portuguese diplomat António Guterres, who previously served as UN High Commissioner for Refugees, became the ninth Secretary-General. Guterres has highlighted several key goals for his administration, including an emphasis on diplomacy for preventing conflicts, more effective peacekeeping efforts, and streamlining the organization to be more responsive and versatile to global needs.