Egypt has asked the Palestinian group Hamas to attend talks "promptly" on the crisis at Gaza's breached border.
Hamas used a bulldozer against the border wall on Saturday
Egypt's foreign minister was speaking after President Hosni Mubarak invited Hamas and its bitter rival Fatah to talks on ending their differences.
It is five days since Hamas blew up the Gaza border wall at Rafah and Egyptian guards were forced to stand back.
Palestinian leader Mahmoud Abbas of Fatah is due to have talks with Israeli Prime Minister Ehud Olmert on Sunday.
Blockaded by Israel, Gaza residents have been flocking into Egypt.
An attempt by Egyptian riot police to reseal the border on Saturday collapsed when Hamas fighters responded to water cannon and electric batons with gunfire.
Thousands of people poured across, many using cars rather than going on foot.
The Gaza crisis began 10 days ago, when Israel cut off supply routes in response to rocket attacks on its territory.
Egypt has been reluctant to talk to Hamas since June when the Islamist group seized control of Gaza, ousting the Palestinian Authority of President Mahmoud Abbas, the BBC's Heba Saleh reports from Cairo.
But now Cairo finds that there is no alternative to discussions with Hamas if it is to restore its control over the border, our Middle East analyst says.
"There will be an invitation to several Hamas leaders to come to Cairo promptly," said Foreign Minister Ahmad Ali Abu-al-Ghayt.
At the same time, he added, a separate invitation would be sent to "the Palestinian leadership", meaning Mr Abbas's administration in the West Bank.
He said Cairo wanted to restore arrangements on the border to their state before Hamas took control of Gaza.
Before June the border was under the control of the Palestinian Authority but traffic through it was supervised by European monitors.
The Egyptian foreign minister said that 38 guards had been injured on the border since it was breached and he warned against further "provocations".
Egyptian security forces have reportedly been turning back Palestinians from Gaza trying to travel beyond the immediate border area on the Egyptian side.
Hamas officials have already said they would welcome talks with Egypt, provided there are no pre-conditions.
17 January: Israel seals border following rise in rocket attacks
20 January: Gaza's only power plant shuts down
22 January: Israel eases restrictions
22 January: Egyptian border guards disperse Palestinian protest against closure
23 January: Border wall breached
"We have announced our acceptance of President Mubarak's esteemed invitation without conditions and under Egyptian sponsorship," Moussa Abu Marzouk, deputy head of Hamas's political bureau, told The Associated Press.
But Mr Abbas reduced the prospect of talks with Hamas on Saturday when he demanded Hamas return control of Gaza to his administration.
He also urged Gazans to stop firing rockets into southern Israel, saying it gave Israel an "excuse" to punish the territory.
He said he would renew his offer to take control of Gaza's border crossings instead of Hamas during talks with the Israeli Prime Minister Ehud Olmert on Sunday.
The two are engaged in a new US-backed peace process that has excluded - and is rejected by - Hamas.