The 26-year-old was expected to leave Boro after last season, when the club was relegated to the Championship.
Zamalek spokesperson Sabri Serag told the club’s official website: “Chairman Mamdouh Abbas exerted lots of efforts to wrap up the deal.
“We paid Middlesbrough £4million to acquire Mido’s services. We can also sign him permanently next summer if we pay £1million to the English side.”