It is well mentioned while reading books on Africa or, the colonization or “scramble” for Africa, that two countries, Liberia and Ethiopia/Abyssinia, had retained their sovereignty as independent countries from European powers. Liberia was not colonized because of support and protection by the US. But how did Ethiopia turn out to be independent?
Abyssinia / Ethiopia (the borders of which expanded and contracted frequently over the centuries) maintained its independence until 1936 by a combination of diplomatic skill in playing would-be colonizers off against each other, and military strength. These factors were, in turn, facilitated by centuries of diplomatic contacts with (as commented on by Denis de Bernardy) Christian Europe and (mostly successfully) dealing with Muslim incursions. Further, Ethiopia's long survival allowed it to develop a national identity which was in no small part due to the unifying force of Christianity. Finally (as commented on by jamesfq), its terrain, although making it difficult for some emperors to enforce unity in more than just name, also made it difficult for foreign invaders to conquer.
As a side note, it is worth pointing out that, while the influence of the US was important for Liberia, it was not the only factor which helped that country maintain its independence (and Liberia did lose some territory).
Unity, Identity and Development
Christianity in Ethiopia dates back to the 4th century. Although never an active participant in the European crusades, the unity of Christian Ethiopia was instrumental in limiting Muslim incursions:
By the end of the fifteenth century, the Christian kingdom had for all practical purposes imposed its will over its enemies.
Source: Saheed A. Adejumobi, 'The History of Etiopia'
Although Ethiopia subsequently fell into disunity, the accession of Emperor Tewodros II (ruled 1855-68) led to the re-establishment of a strong, unified state before the scramble for Africa began in earnest. Further, Tewodros wasted no time in pursuing his goals of unification, reform and innovation:
After his coronation he marched into Wallo, and seized the natural mountain fortress of Magdala which was to become his capital. Later in the year he overran Shoa, the last Christian province outside his control...
Source: R. Pankhurst, 'Ethiopia and Somalia', Chapter 15 in A. Adu Boahen (ed), 'A General History of Africa, volume 6 (UNESCO)
Tedowas also built roads to facilitate the movement of troops, and helped boost trade by imposing peace and law and order. His military reforms (see below) were to prove critical to Ethiopia surviving European ambitions but, before that, these reforms enabled him to unify Ethiopia in the first place. Emperor Yohannes IV (1872-89) built on Tewodros' achievements. After crushing an Egyptian invasion, he allied himself with the British who were hard pressed to deal with the Mahdists in Sudan under Muhammad Ahmad, and defeated them at the Battle of Kufit in 1885. Thus, the British, far from being able to colonize Ethiopia, were in fact reliant on her support for a while as a 'fellow' Christian state. However, this did not prevent the Italians from making initial incursions (on which more below).
Tedowas' successors Yohannes IV and especially Menelik II (1889 to 1913) intensified the modernization of Ethiopia. From the mid 1880s to the first decade of the 20th century, bridges and railways were built, a national currency was introduced, postal and telegraph services set up, and roads and education expanded. These developments were mostly achieved with European assistance. Thus, Ethiopia avoided colonization but provided these foreigners with some of the profits they sought from Africa without having to fight what they realised would have been a costly war.
Diplomacy and Rivalry
As a Christian state, Ethiopia had long had diplomatic contacts with Europeans. The Vatican sent an embassy in 1439, and prior to that there were Catholic missionaries there. In Europe,
A popular geographical document of 1457 known as the Fra Mauro’s map and a succession of writings of the classical era all bore evidence of Ethiopia’s political and commercial notoriety.
Even before then, Pope Eugene IV had invited Ethiopian copts to the Council of Florence in 1439, the Africans arriving in 1441. The Ethiopian emperor also initiated contact (acknowledgement: Peter Taylor) by sending a diplomatic mission to Alfonso V of Aragon:
A Spanish king wrote to Emperor Zara Yakob (1434–68), described as a fanatical Christian who not only encouraged the writing of books, the building of churches, and the instruction of the public through teaching but also helped established religious nationalism and Ethiopian identity.
There were many contacts with the Portuguese and Jesuits in the 16th and 17th centuries, though attempts to impose papal supremacy did not go down well. Despite these, and subsequent, doctrinal differences, the European perception of Ethiopia was notably different to that of other regions of Africa. In the mid 19th century and the early 20th century, this was exploited by Tewedos and his successors through the Ethiopian churches; previous contacts gave Ethiopian rulers the kind of access to European governments which other African leaders either didn't have or were unable to use to their advantage.
Referring to both Ethiopia and Liberia, M. B. Akpan in Liberta and Ethiopia, 1880-1914: the survival of two African states writes:
both were able to play one European power against the other and were able to resist by diplomacy the more indirect pressures of the colonial powers. Menelik certainly succeeded in playing Italy, France and Britain off against each other. Having relied on French arms to defend himself against the Italians in 1896, he made use of the British in 1902 when the French attempted to obtain excessive control over the Djibuti railway.
Source: Chapter 11 in A. Adu Boahen (ed), 'A General History of Africa, volume 7 (UNESCO)
Nonetheless, the treaties Ethiopia made were often very unfavourable and she lost some territory to Italy at various times up to 1896 (see below). In the early 20th century
treaties between European powers and Ethiopia were...laden with new and unequal caveats....The Tripartite Agreement of 1906 between Britain, France, and Italy attempted to divide the country into three spheres of economic interest without any input from Ethiopia’s leader, Emperor Menelik II.
Ethiopia was compelled to make numerous compromises to maintain its independence and modernist aspirations. Such concessions to European economic and trading interests also restricted its diplomatic sovereignty and its social and economic aspirations. For example, in spite of Emperor Menelik’s displeasure with the Tripartite Agreement, he entered into another “Treaty of Friendship and Commerce” with France on January 10, 1908. Although Article 5 of this agreement guaranteed Ethiopia’s right to import firearms through Djibouti and the Protectorate of French Somaliland, the French in return demanded and obtained simultaneous extraterritorial privileges. Article 7 of the agreement specified that French subjects in Ethiopia involved in legal cases must be tried according to French law and, if detained, placed in the custody of the French consul. In a similar vein, the Klobukowski Treaty of 1908 gave European residents in Ethiopia similar extraterritorial rights and fiscal privileges.
Under the emperors Tewedos II, Yohannes IV and Menelek II, Ethiopia modernised and expanded her armed forces until they were the most formidable of any African ruler.
Realizing he could control the country only by military means, Téwodros decided to reorganize his army. His experience with the Egyptians, wrote a British traveller, Henry Dufton, convinced him that the 'primitive mode of warfare' would have to be 'superseded'.
Unable to import significant quantities of modern arms due to hostile neighbours, Tewedos hired expert Europeans to manufacture cannons, mortars and shells in Ethiopia. Tewedos also reorganised the army, partly with the help of John Bell, a British adventurer. Later, Yohannes IV made use of another British adventurer, John Kirkham whose military abilities were
praised by Gordon, who described him as "an officer (there being but few others) in whom I could place implicit trust."
However, the death of Yohannes IV in March 1889 led to the disintegration of the Ethiopian army, a fact which the Italians took advantage of by occupying large parts of the empire. Menelik II (reigned 1889 - 1913) patiently built up army again, importing large quantities of arms from France and Russia. By February 1893 he had 82,000 rifles and 28 cannon.
The main military threat to Ethiopia came from Italy. This was with the tacit approval of the British who did not want see their chief rival, France, gain a large foothold in the region. The Italians, though, faced a formidable foe and suffered a decisive defeat at the Battle of Adowa in 1896.
Had Menelik lost the battle of Adowa, Ethiopia would undoubtedly have become an Italian colony in 1896. But...thanks to her military strength which was far superior to that of Italy in Africa, Ethiopia won that battle and thereby maintained her independence. Even after the battle of Adowa, Menelik persisted in stockpiling arms, a fact confirmed by a British traveller, John Boyes, who noted, early in the twentieth century, that 'practically all the Abyssinians' were 'armed with rifles', and that 'the Abyssinians are the best armed native race in Africa' and 'could not easily be brought under subjection by any foreign Power'. At a military parade held in Addis Ababa in 1902 to commemorate Ethiopia's victory at Adowa, an estimated 600,000 Ethiopian troops - about 100,000 short of the empire's total military strength....All the troops were armed with modern weapons, including rifles, machine guns, and cannon.
As a consequence of this victory,
The Adowa campaign gave Menelik considerable international prestige. The French and British dispatched diplomatic missions to sign treaties with him, while other embassies arrived from the Sudanese Mahdists, the Sultan of the Ottoman empire and the Tsar of Russia.