This time of confusion was temporarily brought to an end by Tewodros II, a member of the local nobility from Qwara, who briefly restored some imperial authority with a series of victories over regional nobles, before committing suicide at Magdala when faced by defeat from a British invasion to release British prisoners in 1868. After another brief hiatus, Yohannis 1V from Tigray region, crowned emperor in 1872, re-established imperial control more successfully, fending off attacks from several external sources. In 1875 and 1876 two Egyptian expeditions were defeated at Gundet and Gura, and in 1887 Ras Alula wiped out an Italian battalion at Dogali briefly putting a stop to Italian incursions inland from Massawa whioch they had taken over in 1995. There were a number of successful battles against the forces of Mohammed Ahmad who proclaimed himself the Mahdi in 1881 but Yohannis himself was killed while winning the battle of Metemma in 1889 against the Mahdi's Dervish army. He, he was succeeded by Minelik, King of Shewa, who expanded the empire to the east, south and west of Shewa, bringing back into imperial control lands that hadn't been part of the Ethiopian polity for several centuries. This expansion coincided with the arrival of European colonial powers in the region, and after the defeat of Italy at the battle of Adowa in 1896, Minelik was able to establish the boundaries of Ethiopia, though despite his victory at Adowa he was unable to expel the Italians from their colony of Eritrea.
Minelik (1889-1913), who founded Addis Ababa as the capital, presided over the first stages of Ethiopian's modernization. He was succeeded by his 13 year old grandson Lij Yasu who was never crowned. Lij Yasu's father was Negus Michael, a Muslim Oromo leader from Wollo who had been converted to Christianity by Yohannis IV. In an Oromo and a converted Muslim, and in his three year reign Lij Yasu showed strong indications of turning away from the largely Amhara and Tigrean Christian highlands, raising the profile of the Muslim and non-Christian peoples of peripheral regions including Oromos, Somalis and Afars. He also favoured links with Germany and the Ottoman Empire. As this was during the First World War, it caused concernes to the British, nervous about control of the route to India, and the French worried about the safety of Djibouti. Thery therefore backed the coup organized by Shoan Amhara nobles in 1916. The result was a coup in 1916, backed by the UK and France, at war with Germany and the Ottoman Empire at the time, and Lij Yasu was replaced by Minelik's daughter, the Empress Zewditu with Ras Taferi as Crown Prince and Regent. In 1930 after the death of the Empress, Ras Taferi was crowned Emperor, taking the throne name of Haile Selassie.
Haile Selassie (Regent 1916-1930, Emperor 1930-74) turned Ethiopia into a centralized autocracy. The process was briefly interrupted by the Italian invasion and occupation conquest of 1935-41. After Ethiopia's liberation with British help in 1941, Haile Selassie found his control of the country circumscribed by his British ‘advisers'; Britian itself came close to trying to occupy Ethiopia was able to play off the United Kingdom, which came close to occupying Ethiopia after 1941 (it only withdrew from the Ogaden in 1948 and the Reserved Area (the Haud) in 1954), and controlled Eritrea under a UN mandate until 1952. Haile Selassie therefore looked more and more to the USA as an alterantive and more powerful ally. against the USA. In 1952, Eritrea, a UN-mandated territory after the war, was federated with Ethiopia. Haile Selassie immediately dismantled its press, trade unions, political parties and its elected parliament, none of which could be found in Ethiopia and which were anathema to his own highly centralized structure of control. In 1962 Eritrea became a province of Ethiopia, igniting the Eritrean struggle for independence, originally led by the Eritrean Liberation Front (ELF), supported by Egypt and other Arab states, and later by the Eritrean People's Liberation Front (EPLF) which eventually achieved de facto Eritrean independence in 1991 and formal recognition in 1993.