Correction to This Article
This article incorrectly said that Foreign Minister Tzipi Livni had not served in the Israeli armed forces. Livni served in the military from 1976 to 1979, attaining the rank of lieutenant.

JERUSALEM, Dec. 30 -- Three Israeli leaders met in secret Friday to review the plan of attack, according to a government spokesman. The targets had been selected, the warplanes readied. Clear skies were forecast over the Gaza Strip.

Hours later, Israeli forces began an aerial assault against the Hamas movement that caught nearly everyone by surprise.

The Israeli campaign is being led not by a single commander in chief, but by a triumvirate of politicians. The three are known to mistrust one another deeply, but all have staked their futures on a highly risky military operation aimed at breaking Hamas's capacity to fire rockets at Israel.

With national elections just over a month away, two of the three are vying for Israel's top job. Defense Minister Ehud Barak and Foreign Minister Tzipi Livni both have led high-profile but fruitless efforts to achieve peace with the Palestinians; now, each is trying to win favor with Israelis by going to war.

All campaigning for the Feb. 10 vote has been temporarily suspended. But Barak, a former prime minister and ex-army commando, is expected to make the case that he can defend the country in times of crisis. Livni, meanwhile, is seeking to overcome concerns that as a woman who never served in the armed forces, she is not tough enough to lead Israel.

Prime Minister Ehud Olmert will not be a candidate in the elections and may be indicted on corruption charges. But the Gaza offensive could be his last chance to rehabilitate a legacy badly tarnished by Israel's failure to achieve a clear-cut victory against the Lebanese Hezbollah movement in 2006.

Waiting in the wings is a fourth leading politician, former prime minister Binyamin Netanyahu. He has long advocated military action in Gaza and, political analysts say, is well positioned to capitalize on Israeli anxiety if the rockets continue to fly.

For the moment, however, the offensive in Gaza is proving popular with Israelis, and Livni and Barak are reaping the benefits. Recent polls show them closing the gap with Likud party leader Netanyahu, who had opened up a wide lead based on his promise to take a hard line against Israel's main adversaries -- Hamas, Hezbollah, Syria and Iran.

Political analysts said the looming elections forced Livni, leader of the centrist Kadima party, and Barak, head of the center-left Labor Party, to opt for military action when Hamas resumed its rocket fire in mid-December, after a six-month truce.

"With Netanyahu leading in the polls, and the security situation deteriorating, it would have killed Livni and Barak if they had let 50 or 60 rockets land every day and done nothing," said Reuven Y. Hazan, a professor of political science at the Hebrew University of Jerusalem.

Indeed, among Palestinians, there is a widespread belief that the decision to launch the Gaza offensive was driven by Israeli politics. Whenever Israelis prepare to vote, they say, Palestinians suffer from Israeli shows of strength. The Gaza offensive has left at least 370 Palestinians dead. Since Saturday, four Israelis have been killed in rocket attacks.

"The Israeli politicians are using this blood bath for the sake of their political campaigns," said Mustafa Barghouti, an independent Palestinian politician based in the West Bank.

Mark Regev, an Israeli government spokesman, denied that politics played a role in the decision to launch the offensive.

This is hardly the first time Israel has held elections during a time of strife. In 1996, during the lead-up to elections, it launched an offensive against Hezbollah forces in Lebanon, and Hamas carried out a series of suicide attacks targeting Israeli buses. Netanyahu pulled off a surprise win against then-Prime Minister Shimon Peres in that vote. More recently, Likud's Ariel Sharon won election in 2001 and 2003 against the backdrop of the second Palestinian intifada.

Traditionally in Israel, violence during election campaigns has favored the more hawkish candidate.

But this time, analysts say, the violence could favor Barak and Livni -- if the Gaza operation succeeds in suppressing rocket fire.

For Barak, the war might be his best chance to save Labor from political irrelevance. The party, which for decades after the country's founding was the dominant force in Israeli politics, has not held the prime ministership since his government fell in 2001 after the collapse of the Camp David peace talks. Recently, the party's poll numbers have been at historic lows.

Since the start of the Gaza operation, those numbers have improved -- Labor is now expected to win 15 seats in the 120-member Israeli parliament, up from 10. Analysts said that is because of a widespread perception that Barak, who developed a reputation as a wily commander in his years of army service, has taken charge of the operation.

"The one who is running the show is Ehud Barak," said Hebrew University political scientist Gabriel Sheffer.

Livni, whose Kadima party leads the current coalition government, is believed to have a better chance of getting the top job: Kadima is running close with Likud in recent polls.

Livni has for the past year been Israel's lead negotiator in U.S.-backed peace talks with the Palestinian Authority, which were intended to culminate with an agreement by the end of this year.

Even before the offensive began, Livni was repositioning herself, giving a series of forceful statements that threatened Hamas with military action unless the group halted its rocket fire.

"If anything, she's been identified with the negotiations with the Palestinians," said one senior Israeli official who spoke on the condition of anonymity. "But at some point, her advisers started telling her she needed to turn to the right."

Olmert, too, has been repositioning himself. Although he had initially hoped to revive his sullied reputation through a peace deal with the Palestinian Authority, he now appears to be banking on a successful operation in Gaza to help erase the stain of the Lebanon war, which was considered a debacle by many Israelis. If the offensive doesn't succeed, however, he will have presided over two failed military campaigns in less than three years.

Continued rocket fire from Gaza could play into the hands of Netanyahu. Having long called for a military campaign against Hamas, he is now openly supporting the government's decision -- but he also suggests that he would go even further if he were in charge.

"I think ultimately we'll have to remove that regime," Netanyahu said of Hamas during a Tuesday interview with CBS. "Not necessarily right away, but I think ultimately that has to be done."