As it became clear that Algeria would be independent, colonists began leaving the country in large numbers. Because of their flight Algeria lost many of its most skilled inhabitants at the beginning of its existence as a modern independent nation. Competing factions in the ruling FLN emerged, but Ahmed Ben Bella attained overall leadership by allying with Colonel Houari Boumediene, chief of staff of the party's military wing, the ALN. A national assembly was elected from candidates selected by Ben Bella.
On September 15, 1962, the new assembly proclaimed the Democratic and Popular Republic of Algeria, with Ben Bella as its premier, or prime minister. Ben Bella appointed Boumediene defense minister, and Ben Bella, Boumediene, and Mohammed Khider, secretary-general of the FLN, became the three most powerful men in the country. However, as Ben Bella gradually increased his control over the country, he alarmed the other leaders.
On July 19,1964, the military under Houari Boumediene overthrew Ben Bella. With military backing, Boumediene ruled the country until his death from illness in 1978. In early 1979 delegates of the National Liberation Front chose Colonel Chadli Bendjedid as the party's presidential candidate. Running unopposed, Bendjedid was elected to office by a nearly unanimous vote in February, 1979.
Algeria's support for the Palestine Liberation Organization (PLO) and for groups seen by the United States as terrorists often created rocky relationships between Algeria and the United States. However, Algeria's major foreign rival during its independence has been its neighbor, Morocco. Although Morocco had supported Algeria's struggle for independence, after independence the countries quarreled over the location of the border between them. Morocco accused Algeria of supporting plots against its government and fighting broke out briefly in 1963.
In 1976 Spain gave up its Western Sahara territories south of Morocco and Morocco took control of most of these lands, with Mauritania taking control of the southern portion. Algeria provided training and support for the Saharan rebels fighting
Against Moroccan rule, increasing the bitterness between the two nations in Africa's far northwest.