Egyptian President Fattah Al-Sisi meets with Palestinian Authority President Mahmoud Abbas.
Egypt moved aggressively against hundreds of Hamas smuggling tunnels after the Muslim Brotherhood-dominated government of Mohamed Morsi was ousted in 2013. It closed its Rafah border crossing into Gaza except for humanitarian supplies, citing security threats. Israel has closed its Gaza border in an attempt to stem the flow of weapons and supplies used to make them from reaching Hamas.
Egypt also revoked the Egyptian citizenship of some Hamas leaders, including co-founder Mahmoud Al Zahar.
Egypt also is wary of Hamas's close ties to Iran, which pours money and weapons into Gaza. Iran expects Hamas to use that support to attack Israel, while Egypt is hoping to keep the area quiet. Last month, Egypt reportedly made Hamas choose between Iran or Palestinian reconciliation, which it is seeking in hopes of reopening its borders.
Egypt and Iran have been feuding since the 1979 Islamic Revolution and Egypt's peace treaty with Israel. Iran has plotted against Egypt for decades.
Hamas, meanwhile, has allowed jihadists to reach Sinai, worrying Egyptian authorities. Many Gaza-trained terrorists used border tunnels to sneak into Egypt and execute attacks. Some of those terrorists belonged to the North Sinai ISIS-affiliate Ansar Bait Al Maqdes. These elements occasionally have attempted to break the Egyptian-Israeli peace by bombing oil pipelines to Israel from Egypt, as well as target attacking Israeli settlements from Sinai.
In 2016, Egypt accused Hamas of involvement in the assassination of Egyptian Public Prosecutor Hisham Barakat, in coordination with Muslim Brotherhood leaders in Turkey.
With Gaza's borders sealed, the tunnels in and out of Egypt became a key supply source for the people and tax revenue for Hamas. Hamas even had a tunnel authority in its government, signifying their extreme importance. That authority was closed in 2014 after Egypt started destroying tunnels.
At that point, some tunnels were large enough to allow vehicles to pass under the borders. After destroying more than 3,000 smuggling tunnels, the Egyptian army engineering corps in 2015 dug a canal stretching 14 kilometers from the Mediterranean Sea to the end of the land borders between Egypt and Gaza. Large tubes pumped in seawater, creating a canal that helped flood another 1,000 tunnels. The Egyptian army built 18 fishing farms inside the canal.
The security situation remains fragile in North Sinai as a large number of citizens were killed in terrorist attacks, including many Copts, forcing many to seek refuge in safer cities such as Suez and Ismailia.
As a result, the Egyptian army decided to demolish the old border city of Rafah to create a security buffer zone with Gaza and relocate its residents to a new Rafah city two kilometers away. This decision dealt Hamas a major blow, since many smuggling tunnels opened inside the town.
Egypt continued to cut all the illegal lifelines that generated the huge finances which kept the terrorist group in power in Gaza since 2007.A Hamas economic ministry spokesman in 2013 claimed that Gaza lost over $230 million per month from fees and taxes after the tunnels were taken out of commission.
Hamas still garners millions of dollars monthly by operating the border when it is opened for humanitarian aid shipments. In 2016, a Hamas employee leaked a document detailing the revenue.
That's why Hamas wants to continue controlling the Rafah border crossing, while Egypt wants the Palestinian Authority (PA) in charge. The PA was designated as the controlling power in a 2017 Hamas-Fatah reconciliation negotiated in Cairo. Breaking all agreements mediated by Egypt, Hamas last month hassled and arrested more than 500 Palestinian Authority representatives in Gaza.
Egypt still controls the Fatah-Hamas reconciliation process and rejects the involvement of other regional countries including Turkey, Qatar and Iran. Those countries have long supported terrorist activities inside Egypt and politically endorsed Muslim Brotherhood terrorism against Egypt. Hence, Egyptians won't allow them to be part of any political arrangement, especially as Egypt plans to host another round of negotiations between Hamas and the PA in Cairo in the upcoming weeks. The negotiations seek a full Palestinian reconciliation, the border status and a possible coalition government, although success is considered highly unlikely in the near future.
Egypt sees the Palestinian Authority as its chief Palestinian ally because it is internationally recognized and recognizes Israel. More importantly, it is the nemesis of Hamas, which always carried hostility toward Egypt and remains allied with Iran.
Accordingly, Egypt will continue to work on clipping the wings of Hamas, realizing the danger the group has carried through the years in undermining Egyptian security and foiling all peace initiatives.
Hany Ghoraba is an Egyptian writer, political and counter-terrorism analyst at Al Ahram Weekly, author of Egypt's Arab Spring: The Long and Winding Road to Democracy and a regular contributor to the BBC.