Egypt on Friday closed its border with the Gaza Strip, Palestinian officials said, after Cairo launched a major operation against jihadists in the Sinai Peninsula.
The head of Hamas, the Islamist group which runs Gaza, was however permitted to travel to Cairo for talks before the border was closed a day earlier than planned.
Friday was supposed to be the final of a three-day border opening for humanitarian cases from Gaza, the first time the Rafah border crossing with Egypt had been open in 2018.
"The Rafah border was closed today due to the security situation in Sinai, we were informed by the Egyptian authorities," said Saleh al-Zaq, head of the civil affairs committee which controls the borders.
The Egyptian army announced Friday morning the launch of a major operation against jihadists across swathes of territory, including the Sinai Peninsula bordering Gaza.
Hamas leader Ismail Haniya crossed the border to Cairo for talks with Egyptian leaders before Rafah was closed, Hamas spokesman Fawzi Barhum said.
He said the talks would include an Egyptian-brokered reconciliation deal between Hamas and rival Palestinian movement Fatah that has faltered, with multiple deadlines missed.
Hamas officials said the visit is to discuss the economic crisis "that put Gaza on the edge of the abyss". Talks will also cover the obstacles stalling a Palestinian unity deal with the Palestinian government in the West Bank.
Thousands of Gazans had gathered on Thursday at the crossing in the hope for a brief chance to leave the Strip.
The UK-based Medical Aid for Palestinians warned on Tuesday that the healthcare system in Gaza is on the verge of "total collapse," due to Israel's decade-old blockade of the strip.