Updated

Hamas' political chief rejected Israeli conditions for a Gaza cease-fire Friday and demanded an immediate opening of the besieged territory's borders, taking a tough line as he asked a summit of Arab countries to back him by cutting off any ties with Israel .

Despite the hard-line comments by the Syrian-based Hamas leader Khaled Mashaal, Israel and Egyptian mediators were expressing optimism a cease-fire could be reached. Israeli government spokesman Mark Regev said he was hopeful that Israel is "entering the endgame" on its Gaza offensive and that a "sustained and durable" stop to Hamas rocket fire on southern Israel was near.

He said Cabinet ministers could make a decision on a cease-fire as early as this weekend.

Israel wants a total end to Hamas' rocket launches into Israel and an arms embargo on Gaza's militant rulers. Hamas has demanded an immediate Israeli withdrawal from Gaza and the opening of blockaded border crossings.

"These are our demands and we don't accept any political movement that does not accept them," the movement's top political leader, Khaled Mashaal, said in a televised address from his headquarters in Damascus, Syria.

Click here for photos of the conflict.

Following a day in which Israeli forces killed a senior Hamas official and shelled a U.N. compound, the Israeli military kept up its pressure on Hamas.

Before dawn Friday, Israeli aircraft struck about 40 targets all over Gaza, according to military officials speaking on condition of anonymity because no announcement had been made. They said targets included smuggling tunnels along the Egyptian border, a rocket launcher ready for firing, launching sites and weapons caches.

Militant rockets, meanwhile, struck six times in southern Israel, causing no injuries, the military said.

After midnight, Israeli Foreign Minister Tzipi Livni left for Washington, where she was expected to sign a memorandum of understanding with the U.S. over ways to stop arms smuggling to Hamas.

"Israel is going to retain its right to defend itself anyway, also when it comes to the smuggling of weapons, not only to rockets being fired at Israel," she said.

In parallel, chief Israeli negotiator Amos Gilad arrived in Cairo Friday for talks with Egyptian officials about how to end the fighting in Gaza

Israeli Prime Minister Ehud Olmert summoned top Cabinet ministers and military commanders for consultations after Gilad's return from Egypt late Thursday.

"Hopefully we're in the final act when we are briefed by Gilad and Livni," Reuters quoted Regev. "There may be a full security cabinet meeting and decisions will stem from that."

Such decisions could be made by Saturday, Israeli officials said.

"The diplomacy now is in high gear... we want this to be over as soon as possible," Regev told the BBC. "The minute we can be sure that the solution will not be a band aid, that after a few days of quiet we won't have more rockets on Israeli civilians, the minute we can understand that that situation will be a sustained peace, then we're going to go for it."

Israeli and Western sources said on Friday that Israel had rebuffed some of the conditions set by Hamas for a cease-fire in Gaza, including how long it will last and who will manage the border crossings Reuters reported.

"A time limit on any period of quiet is a mistake," a senior Israeli source told Reuters. "We saw that when the previous calm ran out of time, it was just an excuse for some to escalate the violence. An open-ended calm is what is needed."

In the West Bank, United Nations chief Ban Ki-moon urged Israel to immediately stop its three-week-old war, meant to halt militant rocket fire on southern Israel from Gaza.

"I strongly urge Israeli leadership and government to declare a cease-fire unilaterally," he said from Ramallah, the seat of the West Bank government of Palestinian President Mahmoud Abbas, Hamas' fierce rival. "It's time to think about a unilateral cease-fire from the Israeli government."

Palestinian doctors have said 1,133 Palestinians have been killed since Israel's offensive began and more than 5,000 are wounded.

The Bush administration was racing in its final days to negotiate a deal on American support for mediation efforts under which the U.S. would give technical support and expertise to prevent Hamas from rearming, said U.S. and Israeli diplomats.

The diplomats spoke on condition of anonymity because of the sensitivity of the talks.

Thursday's intense Israeli military activity in Gaza exacted a steep price from Hamas when Interior Minister Said Siam was killed in an airstrike. Siam was the commander of Hamas security forces including thousands of armed men and was widely feared in Gaza.

Siam was seen as a main architect of the violent Hamas takeover of the Gaza Strip in June 2007, when Hamas fighters expelled forces loyal to Western-backed Palestinian President Mahmoud Abbas.

Siam was the highest Hamas official killed in the offensive. "We are talking about a key person in terms of logistics in the field, and also in the political sense," said Bassem Zbeidy, a Hamas expert in the West Bank.

He said Siam's death was a "huge loss for Hamas," but noted that the movement is easily capable of generating new leaders, often more radical than their predecessors.

Israel infuriated the U.N. Thursday when it shelled the world body's headquarters in Gaza City, where hundreds of Gazans were seeking cover from the fighting among food and supplies meant for refugees.

The destruction added to what aid groups say is a humanitarian crisis in Gaza and ratcheted up tensions between Israel and the international community even as diplomats indicated progress in cease-fire talks.

The U.N. compound, made up of workshops and warehouses as well as offices, was struck about a half-dozen times over a roughly two-hour period while more than 700 civilians were sheltering there, said John Ging, head of Gaza operations for the U.N. Relief and Works Agency.

The civilians were huddling in the compound's vocational training center when it was struck by a tank round or an artillery shell, wounding three, Ging said. Throughout this time, he said, U.N. officials were frantically contacting Israeli officials to urge an end to the firing on the U.N. compound.

The U.N. compound distributes food aid to hundreds of thousands of Palestinians in the tiny seaside territory of 1.4 million people.

Olmert said Hamas militants opened fire from the U.N. compound. "It is absolutely true that we were attacked from that place, but the consequences are very sad and we apologize for it," he said. The military said it was still investigating.

Ging hotly denied that militants fired from the U.N. compound, calling the explanation "total nonsense" and "typical misinformation."

The attack triggered a raging fire that engulfed a warehouse and destroyed a large amount of food and other aid intended for Gaza's beleaguered citizens. Workers with fire extinguishers and Palestinian firefighters, some wearing bulletproof jackets, struggled to douse flames and tugged bags of flour from the debris.

Fuel supplies and cars in a garage also went up in flames.

During the day an artillery shell hit the Quds Hospital pharmacy, and another shell landed on its front steps early in the day. It caught fire after nightfall, forcing the evacuation.

"There's gunfire, and warplanes above us," medic Abdul Aziz Aishe said by cell phone as he and a group of people fled. Ambulances ferried them to another hospital.

Also taking Israeli fire were buildings where foreign correspondents work, triggering a stern protest from the Foreign Press Association, which said the military was informed about exactly where the journalists' buildings are located.

The strikes on the U.N. compound, the hospital and the reporters' offices were a hint of what could happen if Israel decides to widen its operation in Gaza. Up to now Israel has pelted areas of Gaza with heavy artillery fire to frighten civilians away before sending in ground forces — a way to reduce Israeli casualties as well as harm to Palestinian civilians. The farther the Israelis press into the overcrowded city, the more such incidents can be expected.

As the Israelis pressed forward, Gaza militants kept up their rocket fire at Israel, firing about 20 rockets on Thursday. One long-range rocket hit the city of Beersheba, wounding five people, including a 7-year-old boy who was in critical condition, hospital officials said.

The Associated Press contributed to this report.