In a pre-dawn agreement reached early Wednesday, Olmert's Kadima Party told the Labor Party that it will hold primary elections by Sept. 25. But the primary is likely to oust Olmert as Kadima leader.
The pledge prompted the Labor Party to rescind its support for a motion to dissolve the Parliament, which had been expected to pass within hours.
"The real meaning of this [agreement] is that the state of Israel has been extricated from its daily preoccupation with holding new national elections," Kadima negotiator Tzachi Hanegbi told Israel Radio, reported to Reuters.
The deal came a month after Olmert's popularity was dealt a severe blow by a U.S. businessman's testimony in a corruption case against the Israeli leader. The businessman said he gave Olmert more than $150,000 in cash, in part to finance a lavish lifestyle.
Labor Party leader, Defense Minister Ehud Barak, threatened to force new elections after the court testimony unless Olmert resigned or agreed to Kadima primaries.
Olmert, who denies any wrongdoing but has pledged to resign if indicted, had threatened to fire Labor ministers should their faction join forces with opposition leader Benjamin Netanyahu to dissolve Parliament and trigger an early election.
Ratification of the bill would have undermined the government at a time when Olmert is persisting in efforts to resume peace talks with Syria. The two nations are currently holding indirect talks through Turkish mediators. Israel also could launch a broad military campaign in Hamas-controlled Gaza if a fragile truce doesn't hold.
On Tuesday, Palestinian militants fired rockets into Israel, lightly wounding two Israelis. It was the first attack since the Egyptian-brokered truce in the Gaza Strip took effect on Thursday.
Israel responded by not opening its border crossings with Gaza for routine operations on Wednesday. Under the ceasefire, Israel had agreed to ease its embargo on the impoverished Hamas-ruled territory by allowing in more key imports.
Hamas said it remains committed to a ceasefire with Israel, but will not act as Israel's "police force" in confronting militants who breach the truce.
"Even if there is a violation by some factions, Hamas emphasizes its commitment to the calm and is working to implement the calm," Hamas leader Khalil al-Haya said.
"But Hamas is not going to be a police securing the border of the occupation," he added. "No one will enjoy a happy moment seeing Hamas holding a rifle in the face of a resistance fighter."