Born near Sirte to an impoverished Bedouin family, he became an Arab nationalist while at school in Sabha, later enrolling in the Royal Military Academy, Benghazi. Within the military he founded a revolutionary cell which deposed the Western-backed Senussi monarchy of Idris in a 1969 coup. Having taken power, Gaddafi converted Libya into a republic governed by his Revolutionary Command Council. Ruling by decree, he ejected both the Italian population and Western military bases from Libya while strengthening ties to Arab nationalist governments—particularly Gamal Abdel Nasser's Egypt—and unsuccessfully advocating Pan-Arab political union. An Islamic modernist, he introduced sharia as the basis for the legal system and promoted "Islamic socialism". He nationalized the oil industry and used the increasing state revenues to bolster the military, fund foreign revolutionaries, and implement social programs emphasizing house-building, healthcare, and education projects. In 1973, he initiated a "Popular Revolution" with the formation of General People's Committees, purported to be a system of direct democracy, but retained personal control over major decisions. He outlined his Third International Theory that year, publishing these ideas in The Green Book.
Gaddafi transformed Libya into a new socialist state called a Jamahiriya ("state of the masses") in 1977. He officially adopted a symbolic role in governance but remained head of both the military and the Revolutionary Committees responsible for policing and suppressing dissent. During the 1970s and 1980s, Libya's unsuccessful border conflicts with Egypt and Chad, support for foreign militants, and alleged responsibility for the Lockerbie bombing left it increasingly isolated on the international stage. A particularly hostile relationship developed with the United States, United Kingdom, and Israel, resulting in the 1986 U.S. bombing of Libya and United Nations-imposed economic sanctions. From 1999, Gaddafi rejected Arab socialism and encouraged economic privatization, rapprochement with Western nations, and Pan-Africanism; he was Chairperson of the African Union from 2009–10. Amid the 2011 Arab Spring, protests against widespread corruption and unemployment broke out in eastern Libya. The situation descended into civil war, in which NATO intervened militarily on the side of the anti-Gaddafist National Transitional Council (NTC). The government was overthrown and Gaddafi retreated to Sirte, only to be captured and killed by NTC militants.
A highly divisive figure, Gaddafi dominated Libya's politics for four decades and was the subject of a pervasive cult of personality. He was decorated with various awards and lauded for his anti-imperialist stance, support for Arab and then African unity, and for significant improvements that his government brought to the Libyan people's quality of life. Conversely, Islamic fundamentalists strongly opposed his social and economic reforms and he was posthumously accused of sexual abuse. He was internationally condemned as a dictator whose authoritarian administration violated human rights and financed global terrorism.
Muammar Mohammed Abu Minyar Gaddafi was born at a tent, near Qasr Abu Hadi, a rural area outside the town of Sirte in the deserts of Tripolitania, western Libya. His family came from a small, relatively uninfluential tribal group called the Qadhadhfa, who were Arabized Berber in heritage. His mother was named Aisha (died 1978), and his father, Mohammad Abdul Salam bin Hamed bin Mohammad, was known as Abu Meniar (died 1985); the latter earned a meagre subsistence as a goat and camel herder. Nomadic Bedouins were illiterate and kept no birth records. As such, Gaddafi's date of birth is not known with certainty, and sources have set it in 1942 or in the spring of 1943, although his biographers David Blundy and Andrew Lycett noted that it could have been pre-1940. His parents' only surviving son, he had three older sisters. Gaddafi's upbringing in Bedouin culture influenced his personal tastes for the rest of his life; he preferred the desert over the city and would retreat there to meditate.
From childhood, Gaddafi was aware of the involvement of European colonialists in Libya; his nation was occupied by Italy, and during the North African Campaign of World War II it witnessed conflict between Italian and British troops. According to later claims, Gaddafi's paternal grandfather, Abdessalam Bouminyar, was killed by the Italian Army during the Italian invasion of 1911. At World War II's end in 1945, Libya was occupied by British and French forces. Although Britain and France intended on dividing the nation between their empires, the General Assembly of the United Nations (UN) declared that the country be granted political independence. In 1951, the UN created the United Kingdom of Libya, a federal state under the leadership of a pro-Western monarch, Idris, who banned political parties and centralized power in his monarchy.
Gaddafi's earliest education was of a religious nature, imparted by a local Islamic teacher. Subsequently, moving to nearby Sirte to attend elementary school, he progressed through six grades in four years. Education in Libya was not free, but his father thought it would greatly benefit his son despite the financial strain. During the week Gaddafi slept in a mosque, and at weekends walked 20 miles to visit his parents. At school, Gaddafi was bullied for being a Bedouin, but was proud of his identity and encouraged pride in other Bedouin children. Aside from that, he was the oldest boy in his class. From Sirte, he and his family moved to the market town of Sabha in Fezzan, south-central Libya, where his father worked as a caretaker for a tribal leader while Muammar attended secondary school, something neither parent had done. Gaddafi was popular at this school; some friends made there received significant jobs in his later administration, most notably his best friend Abdul Salam Jalloud.
Many teachers at Sabha were Egyptian, and for the first time Gaddafi had access to pan-Arab newspapers and radio broadcasts, most notably the Cairo-based Voice of the Arabs. Growing up, Gaddafi witnessed significant events rock the Arab world, including the 1948 Arab–Israeli War, the Egyptian Revolution of 1952, the Suez Crisis of 1956, and the short-lived existence of the United Arab Republic between 1958 and 1961. Gaddafi admired the political changes implemented in the Arab Republic of Egypt under his hero, President Gamal Abdel Nasser. Nasser argued for Arab nationalism; the rejection of Western colonialism, neo-colonialism, and Zionism; and a transition from capitalism to socialism. Gaddafi was influenced by Nasser's book, Philosophy of the Revolution, which outlined how to initiate a coup. One of Gaddafi's Egyptian teachers, Mahmoud Efay, was reportedly sympathetic towards the future leader's political ideas, and advised him that a successful revolution would need the support of the army.