SHARM EL-SHEIK, Egypt - Israel says it has obtained a pledge from Egypt not to reopen its border crossing with the Hamas-run Gaza Strip until a captive Israeli soldier is set free.

Israeli officials say the pledge came during talks between Israeli Prime Minister Ehud Olmert and Egyptian President Hosni Mubarak at the Red Sea resort of Sharm el-Sheik.

The meeting came on the sixth day of an Egyptian-mediated truce between Israel and Hamas.

The fragile truce has mostly held, but Israeli authorities say Palestinian militants fired at least three rockets into southern Israel on Tuesday - the first such attack since the ceasefire took effect.

Israel's national rescue service said two people were lightly wounded in the barrage, and Olmert's office called the attack a violation of the truce. There was no word on how Israel would react.

Islamic Jihad group claimed responsibility for the violence, saying it was avenging an Israeli military raid that killed two Palestinians in the West Bank. The Gaza Strip's Hamas government says it remains committed to the truce.

The pledge on the Rafah crossing was seen as a gesture of commitment by Egypt that it would try to gain the freedom soon of Sgt. Gilad Schalit, captured by militants affiliated with Gaza's Hamas rulers two years ago.

After two hours of Mubarak-Olmert talks, Olmert's spokesman Mark Regev told Egyptian media: "Rafah crossing will not be open and return to normal business unless Schalit is released."

Hamas had wanted the crossing opened before an eventual release.

An Israeli official with Olmert's delegation said Egypt gave "assurances" the border crossing would not open without Schalit's release. The official also said that an Israeli negotiator on prisoners was to come to Egypt by the end of the week for "intensive negotiations" on Schalit.

The official spoke on condition of anonymity as no formal statement was released by either side.

Mubarak's spokesman Suleiman Awwad said Rafah would not be open until European border monitors can return - a step that would require Israeli consent. The monitors were deployed at Rafah after a 2005 deal but withdrew when Hamas took over Gaza.

"There are contacts underway ... to create circumstances for the return to the November 2005 protocol," Awwad said.

He described Mubarak-Olmert talks as "transparent, frank and clear" and added that Egypt was "determined to strike the deal of a prisoners' swap between the two sides."

Before heading into talks with Olmert, Mubarak said Egypt "was making efforts" for Schalit's release and would continue to do so. Olmert, meanwhile, lauded Egypt for trying to "achieve the conditions to end the terror from Gaza toward residents of Israel."

In exchange for Schalit, Hamas wants Israel to release 450 prisoners it is holding. Israel has balked at freeing most of those Hamas wants, saying they were involved in deadly attacks on Israelis.

Arms smuggling into the coastal Gaza Strip was also discussed by the two leaders, Awwad said. Israel has sought assurances that Egypt will do more to fight the smuggling.

The Egyptian-brokered truce started last Thursday, with the immediate aim to end the fighting that has killed seven Israelis and more than 400 Palestinians - many of them civilians - since the Islamic Hamas militants overran Gaza a year ago.

Egypt acted as middleman for the six-month truce because Israel, like much of the international community, shuns Hamas for refusing to recognize Israel or renounce the use of force to create a Palestinian state.

In agreeing to the truce, Israel dropped an earlier demand that Hamas free Schalit as a condition for the ceasefire. Hamas seized Schalit in a cross-border raid in 2006, killing two other members of his tank crew.

Egypt's pledge on the Gaza crossing was also a win for Schalit's parents, who asked Israel's supreme court on Saturday to block the truce deal so long as their son remains in captivity.

Noam and Aviva Schalit petitioned the court on behalf of their son, claiming that the deal included the opening of the Gaza crossing. They said this would allow their son's captors to smuggle him out and harm efforts to free him.

Other violence coincided with the Olmert-Mubarak meeting, this time in the West Bank, ruled by the more moderate Palestinian President Mahmoud Abbas.

Israeli troops killed a senior Islamic Jihad commander in a West Bank raid early Tuesday, and the militant faction vowed reprisal.

A neighbour said a Palestinian bystander was also shot to death by troops when he opened the door of his apartment during the raid in the town of Nablus. The Israeli military spokesman's office claimed the man was a militant killed during a gunbattle with troops.

Islamic Jihad is party to the truce between Israel and Hamas, although that arrangement does not apply to the West Bank.

In Gaza, Hamas spokesman Fawzi Barhoum accused Israel of trying to "disrupt the atmosphere of calm that started five days ago" with the latest incident.

Gaza is a tiny, impoverished seaside territory of 1.4 million people that Israel evacuated in 2005 after a 38-year military occupation.