Amalric led his first expedition into Egypt in 1163, claiming that the Fatimids had not paid the yearly tribute that had begun during the reign of Baldwin III. The vizier, Dirgham, had recently overthrown the vizier
Shawar, and marched out to meet Amalric at
Pelusium, but was defeated and forced to retreat to
Bilbeis. The Egyptians then opened up the
Nile dams and let the river flood, hoping to prevent Amalric from invading any further. Amalric returned home but Shawar fled to the court of Nur ad-Din, who sent his general
Shirkuh to settle the dispute in 1164. In response Dirgham sought help from Amalric, but Shirkuh and Shawar arrived before Amalric could intervene and Dirgham was killed. Shawar, however, feared that Shirkuh would seize power for himself, and he too looked to Amalric for assistance. Amalric returned to Egypt in 1164 and besieged Shirkuh in Bilbeis until Shirkuh retreated to Damascus.
Amalric could not follow up on his success in Egypt because Nur ad-Din was active in Syria, having taken
Bohemund III of Antioch and
Raymond III of Tripoli prisoner at the
Battle of Harim during Amalric's absence. Amalric rushed to take up the regency of Antioch and Tripoli and secured Bohemund's ransom in 1165 (Raymond remained in prison until 1173). The year 1166 was relatively quiet, but Amalric sent envoys to the
Byzantine Empire seeking an alliance and a Byzantine wife, and throughout the year had to deal with raids by Nur ad-Din, who captured
Banias.
In 1167, Nur ad-Din sent Shirkuh back to Egypt and Amalric once again followed him, establishing a camp near
Cairo; Shawar again allied with Amalric as well and a treaty was signed with the caliph
al-Adid himself. Shirkuh encamped on the opposite side of the
Nile. After an indecisive battle, Amalric retreated to Cairo and Shirkuh took his troops to capture
Alexandria; Amalric followed and besieged Shirkuh there, aided by a fleet from Jerusalem. Shirkuh negotiated for peace and Alexandria was handed over to Amalric. However Amalric could not remain there forever, and after exacting an enormous tribute, returned to Jerusalem.