It was reported in recent months that the Israel Electric Corporation had agreed to forgo over $1.2 billion of the $1.8 billion it was awarded from Egyptian gas companies in Swiss arbitration proceedings.

A quick recap: Egypt did not live up to its commitments to supply natural gas to Israel because of a series of bombing attacks on its main pipeline in Sinai. The compensation agreed on during arbitration over that failure was significantly lower than the amount Israel initially demanded—and now it seems Israel must forgo about 70 percent of that, without any Egyptian concession whatsoever.

The Israeli concession was announced at a time when there are over 34,000 illegal migrants in Israel who crossed into the country via the Egyptian border. Some of them spent months, if not years, in Egypt before deciding to upgrade their lifestyle and sneak into Israel.

Apart from its basic obligation to prevent illegal migration from its territory, Egypt is a signatory to the United Nations Refugee Convention and home to a large and well-funded branch of the U.N. Refugee Agency. The obligation to review and address requests for asylum, as well as the obligation to take back the asylum-seekers who crossed into Israel from Egypt, falls on the Egyptians, because Egypt is considered the first asylum state that many of the migrants passed through.

This is a principle of international law that is anchored in European law, including the Dublin III Regulation, in which European Union member states agreed to take back illegal migrants who cross their borders into other countries. Agreements to return migrant infiltrators have also been signed between the European Union and Turkey, and even between the United States and Canada.

In 2007, former Israeli Prime Minister Ehud Olmert signed the same agreement with former Egyptian leader Hosni Mubarak—a deal that was brokered by the U.N. High Commissioner on Refugees, no less. The agreement sets down a procedure for returning the migrants, under which the Israel Defense Forces would return captured infiltrators.

However, implementation of the directive hit a snag when radical groups threw up difficulties and petitioned Israel’s High Court of Justice, and eventually it was halted entirely following the rise of the Muslim Brotherhood in Egypt in 2011-2012.

Currently, Israel has good relations with the government of Egyptian President Abdel-Fattah Sisi, but it nevertheless chose to sign deals with other African nations that were willing to take in the migrants, with only partial success. Although these agreements are valid under international law, it is important to remember that the illegal migrants have no legal ties to these nations, unlike Egypt, which by law is required to take back the migrants who crossed its borders illegally.

It is also important to keep in mind that hundreds of thousands of Sudanese and Eritreans are already living in Egypt. Given its size and population, taking back the migrants now in Israel requires a relatively small effort on the part of the Egyptians, certainly when we take into account the huge sums of money in play and Egypt’s already shaky economy.

This is no far-reaching demand—and Egypt won’t even need to take back all the illegal migrants in Israel. Past experience also indicates that most of the migrants deported from Israel will choose to go back to their native countries or depart for a third country, so the number who actually return to Egypt to live will be even lower.

Now we have a historic opportunity: even if the deal with the IEC is already signed, it must be ratified, and Israel can still insert the demand that Egypt take back the migrants that passed through it en route to Israel. If we are being forced to give up such a huge amount of money, the prime minister must link the deal to the migrant issue and demand compensation from Egypt.

Yonatan Yakobovich is the director of the Israeli Immigration Policy Center.

This column first appeared in Israel Hayom.