Hamas officials on Tuesday gave Palestinian President Mahmoud Abbas the go-ahead for negotiations with Israel, a major shift in the militant Islamic group's position toward the Jewish state as it worked to end its international isolation.

As Palestinian officials pushed ahead with efforts to form a national unity government, an Israeli military court ordered the release of 19 Hamas officials — including Cabinet ministers and lawmakers — from an Israeli prison.

The men, arrested by Israel following the June 25 capture of Israeli Cpl. Gilad Shalit by Hamas-linked militants, will remain behind bars for several more days pending an appeal by prosecutors.

Israeli officials said the court decision was not meant to reward Hamas for its moves toward moderation.

"I don't think that right now we would be making gestures of goodwill for the Hamas. We would be making gestures of goodwill to Abu Mazen," Israeli government spokeswoman Miri Eisin said, referring to the moderate Abbas by his nickname. Eisin said the courts were independent of the government.

Click here to go to FOXNews.com's Mideast Center.

Hamas, whose ideology calls for Israel's destruction, reached agreement Monday with Abbas' Fatah Party to form a unity government in an effort to end the financial crisis crippling the Palestinian economy. International donors cut off aid to the Palestinian Authority when Hamas formed its Cabinet six months ago. Hamas is listed as a terror group by Israel and the West.

Abbas has long pushed for a resumption of peace talks with Israel, and Hamas said Tuesday he would have full authority to hold those negotiations.

Prime Minister Ismail Haniyeh, a Hamas leader, said the government itself would not be involved in the talks because negotiations are supposed to be handled by the Palestine Liberation Organization, headed by Abbas. The distinction could allow Hamas to retain its hard-line credentials with the Palestinian street, while the government gains international acceptance.

Ghazi Hamad, a spokesman for the Hamas-led government, told Israel's Army Radio in Hebrew that the Palestinians would be ready to establish a state in territories captured by Israel in the 1967 Mideast war — the West Bank, Gaza and east Jerusalem.

Visiting Spanish Foreign Minister Miguel Moratinos said the new Palestinian coalition could be a "positive step in principle," but he stopped short of saying whether it would be sufficient to persuade the EU to restore aid to the Palestinian Authority. "We'll have to study the details at the next meeting in Brussels, which will be on Friday, before we can come to an answer," Moratinos said.

While he said Hamas would not recognize Israel's right to exist, the joint government is to be based on a platform that many believe implies recognition of the Jewish state.

"We have nothing against negotiations, we have nothing against a diplomatic process, but we have rights," Hamad said.

CountryWatch: Israel

Israel, the U.S. and European Union have said Hamas must renounce violence, recognize Israel's right to exist and accept past peace agreements.

With negotiations over the government guidelines continuing, no date was set for it to take office.

Israeli Foreign Minister Tzipi Livni was heading to Washington on Tuesday for talks with U.S. Secretary of State Condoleezza Rice.

Israel wants to ensure that the international community does not reward Hamas for half measures, Foreign Ministry spokesman Mark Regev said.

"If the new Palestinian government reaches the three benchmarks and Gilad Shalit is released, then things could move ahead very quickly," Regev said. "Anything less than that is just a recipe for further stagnation."

Shalit's capture sparked a broad Israeli offensive in Gaza, and security forces arrested three dozen Hamas officials on charges of belonging to a banned group.

The military judge, who ruled Tuesday that 18 of those officials should be released, questioned the timing of the arrests, noting that the men were permitted to run for office and serve in the Palestinian government for months before their detentions. He said the politicians — including parliament speaker Abdel Aziz Duaik and Religious Affairs Minister Nayef Rajoub — should be set free. In a separate hearing, a judge ordered Deputy Prime Minister Nasser Shaer freed.

Prosecutors plan to appeal Thursday. Decisions are expected next week. In the meantime, the 19 remain in prison.

Earlier this week the court ordered the release of three other Hamas members. That appeal is to be heard Wednesday.

"The arrest of the parliamentarians and ministers was from the beginning an unjust arrest," Haniyeh said. "We hope all of them will be released."

Despite the apparent easing of tensions, Hamas gunmen, along with members of another militant group, battled Israeli troops operating near the border with Israel, killing one soldier early Tuesday, the army said.

Also Tuesday, Egyptian security forces discovered a cache of rifles, pistols and explosives that police said were to be smuggled into Gaza through a tunnel. Gaza militants have routinely smuggled in weapons from Egypt since Israel pulled out of Gaza last year.

Israeli troops also shot and killed a 13-year-old boy during a raid Tuesday in the West Bank town of Bethlehem after youths began pelting troops with stones, witnesses and hospital officials said. The Israeli military said soldiers fired after they were attacked by Palestinians. One soldier was wounded.