As much of sub-Saharan Africa was being colonized by European powers, North African leaders sought to expand and solidify their power on the continent. The Khedive of Egypt, Ismail Pasha, aspired to expand his kingdom's reach over the entire Nile region and Red Sea coast, and began slowly encroaching on Ethiopia's borders. After annexing Darfur in 1875, he turned his attention to Ethiopia. He wished to create an empire covering the whole of the Nile River, much of which is in Ethiopia, and to do this he built a large army, recruiting many European and American officers. Yohannes IV became the emperor of Ethiopia in 1872 after defeating Tekle Giyorgis II in battle. He worked on modernizing his army, some of whom were trained by the British adventurer John Kirkham. Emperor Yohannes IV (King John to the English) as a Christian leader in a predominantly Muslim region, Yohannes sought to Westernize and modernize the Ethiopian military and build alliances with European powers, particularly Britain's Queen Victoria. After Egyptian troops began occupying Ethiopian territories in the area of modern-day Eritrea, Yohannes appealed to Queen Victoria for aid. Although Yohannes was unable to gain European support for his cause, he managed to repel the Egyptian force and solidify his power in the region.
The Egyptians invaded from their coastal possessions in what is now Eritrea. The armies of Yohannes and Isma'il met at Gundat on the morning of 16 November 1875. The Egyptians were vastly outnumbered and their forces were completely destroyed. News of this huge defeat was suppressed in Egypt for fear that it would undermine the government of the Khedive. The Egyptians tried again to invade from the north, but were again defeated at the battle of Gura in March 1876. Ethiopia and Egypt remained in a state of tension, which largely abated after the 1884 Hewett Treaty.