Updated

Scores of Palestinians crossed from Gaza into Egypt (search) Wednesday evening before Egyptian security forces closed the border in an attempt to restore order three days after Israel left the territory.

Elsewhere in Gaza (search), a Hamas militant disrupted a celebratory rally at an abandoned Jewish settlement, grabbing a microphone from a rap singer who was led away by police firing into the air. No one was injured.

Imposing security in unruly Gaza is seen as the key test of Palestinian Prime Minister Mahmoud Abbas' (search) government. Earlier Wednesday, one of his top aides unveiled what he said was a new plan of action — including a demand that armed groups disband immediately after parliamentary elections in January.

Hamas swiftly reiterated that it would not disarm, and Palestinian officials cautioned they will not risk civil war, despite intense international pressure to confront militants. A stalemate could hamper the rebuilding of impoverished Gaza and cloud prospects for the resumption of peace talks.

At the border, people scaled a high wall separating Egypt from Gaza and taxis full of Palestinians headed toward the Egyptian coastal town of el-Arish, about 25 miles to the west, after the 6 p.m. deadline.

When the Egyptians closed the border, a senior police officer bellowed into a bullhorn, telling Palestinians to stop entering Egypt and prepare to return to Gaza. Police guarded barbed wire fence on the Egyptian side of the frontier, blocking hundreds of people on either side of the border as well as inside a buffer area in between.

An Egyptian police official, who declined to be identified further for security reasons, said the remainder of 750 heavily armed border guards will deploy to the area by 7 a.m. Thursday.

Palestinians had been warned to return by sunset when passport controls would be reimposed and all trespassers arrested. The once heavily guarded border has been wide open since the Israelis left, with thousands of people crossing in both directions amid scenes of chaos.

Egypt also said Wednesday that its border guards found an arms-smuggling tunnel under the Gaza border in the al-Duhniya area, 21/2 miles south of the Rafah crossing point.

The tunnel, found Tuesday evening, contained 38 firearms and three rocket-propelled grenades, said a security official, speaking on condition of anonymity because he was not authorized to inform the press. The tunnel penetrated to the Palestinian side of the frontier, and Palestinian security forces seized the weapons Wednesday, the official said.

The smuggling of weapons from Egypt was a major concern of the Israeli military administration that ruled Gaza from 1967 until Monday. The Israeli withdrawal was conditional on Egypt's deploying border troops to prevent arms smuggling.

Abbas' security forces largely have displayed weakness since the Israeli withdrawal. By contrast, Hamas brought tens of thousands into Gaza City's main square late Tuesday — the first day Palestinians controlled Gaza — for the biggest rally here by the Islamic militant group.

Abbas stayed away from an official celebration he scheduled Wednesday near the ruins of the Neve Dekalim settlement. An aide said he was concerned about gunmen, but the Hamas activist was the only disruption.

The rally had been billed as a show of Palestinian unity, but most factions stayed away, frustrating Abbas's hopes. Hamas scheduled another rally for Friday.

The main speaker at the rally, Abbas aide Tayeb Abdel Rahim, said Palestinians would never fire at each other and appealed for unity: "Dialogue is our way, we have no other option other than dialogue and democracy."

Some participants were disappointed. "I was expecting a bigger celebration," said Abu Abdullah Asuna, 40. "It doesn't fit the size of the victory."

The most immediate test of the Palestinian security forces was to make good on a pledge to seal the Gaza-Egypt border.

By midday Wednesday, busloads of Palestinian police were being deployed to try to prevent cars from reaching the area. However, Palestinian militants blew up a section of an Israeli-built metal wall to make it easier for people to cross. The gunmen cleared the area to prevent casualties, and Palestinian police did not intervene.

Egyptian guards began checking identity cards for the first time Wednesday, and turned back some people.

Israeli Defense Minister Shaul Mofaz said Israel has issued formal complaints about Egypt's failure to take control. "We have passed on messages to the Egyptians and the Palestinians, and to the Americans, that we will not accept this. I hope the Egyptians get control of the situation as soon as possible," he said.

Israel is concerned about the possible influx of weapons and militants, and one Palestinian border official said the price of Kalashnikov assault rifles has been cut in half, to about $1,000, because of increased smuggling into Gaza.

Palestinian chief of staff Rafiq Husseini said Abbas' new security plan would first deal with militants in his ruling Fatah movement and then with rival groups. "Our plan is that ... by the election, the Palestinian street will be cleaned of militias and illegal weapons," Husseini said.

Starting next week, all Fatah-affiliated gunmen would be absorbed into the security forces, he said.

"There are thousands of Fatah militiamen in Gaza, but luckily most of them are on the payroll of the Palestinian security apparatus, and that's what makes it easier to handle them," Husseini said. "We waited until the (Israeli) withdrawal, because it would be easier to disband Fatah militias after the withdrawal."

The final phase "will include all Palestinian factions, and it ends with the parliamentary elections, as the president will ask all factions that have seats in the legislative council to disband their military wings in the areas under Palestinian control," he said.

Hamas leader Mahmoud Zahar hotly rejected the demand to disarm, warning that if Abbas' security forces confronted Hamas, they would face opposition from all Palestinians. "We will not allow for even one gun to be taken away from us," he told The Associated Press. "Why should we give up our weapons while Israel still threatens our borders?"

The January vote marks the first time Hamas is competing in general elections, and the group is expected to make a strong showing. Abbas hopes Hamas will transform itself into a political party.

However, Palestinian Information Minister Nabil Shaath reiterated Wednesday that weapons would only be collected by agreement. "We will not wage an internal war for the sake of this issue," he said.