Israel's defence minister, Ehud Barak, has announced he will retire from party politics at the next election in January. But the former prime minister kept open the possibility of retaining the defence portfolio if the prime minister, Binyamin Netanyahu, is re-elected and reappoints him to the cabinet as an individual, not a party leader, in the governing coalition.

Barak said he will not run in the election and that he wanted to spend more time with his family.

"There are many ways to contribute to the state, politics isn't the only one," he said. "My decision to retire stems from my desire to devote that time to my family, and also because I have never felt that politics was the height of my ambition.

"I made the decision not without qualms but ultimately with a whole heart."

Asked if he could serve as defence minister in the next government, he said the question was irrelevant.

Politicians close to Netanyahu told Israel Radio there was no reason for Barak not to be defence minister as a civilian if the prime minister chooses to appoint him after the elections.

Avigdor Lieberman, leader of Yisrael Beiteinu which has merged with Netanyahu's Likud party for the election, is touted as the likely next defence minister. The agreement gives Lieberman the right to choose any cabinet portfolio he wants; he has indicated defence. However, Lieberman is under investigation for fraud, money-laundering and witness tampering. If he were to be charged, he would not be able to take up a cabinet position.

Barak's announcement shakes up the vote because his Independence party is part of Netanyahu's coalition. It was launched after Barak quit as Labour party leader because a majority of its MPs were opposed to remaining in Netanyahu's government over its stalling of the peace process with the Palestinians.

The Independence party failed to widen its base of support over the past two years with some surveys suggesting voters would deal it an embarrassing blow in January's election. But it did receive a bounce in the polls from Barak's handling of this month's assault on Gaza.

His announcement adds a fresh twist to the ever-shifting alliances of Israeli politics. It also comes as Tzipi Livni, Israel's former foreign minister and former head of the Kadima party founded by Ariel Sharon, plans to launch a new party this week and return to politics, which can be expected to divide the centre-left vote.

Barak's announcement was applauded by rightwing parties allied to Jewish settlers in the occupied territories. They said his actions as defence minister, including agreeing to a partial freeze on settlement construction, had hurt their cause. Hamas claimed Barak's retirement was another success for its military campaign and was brought about by the recent fighting in Gaza.

Barak trumpeted his proudest achievements, including more than 50 years in the military.

"This is the culmination of seven and a half years in this office, two terms under three governments, one of which I was at the head. Years in which, along with others, I led the defence establishment and the IDF [Israel Defence Force], through the rehabilitation after the second Lebanon war, strengthening our 'long arm' and building our operational capabilities to cope with the Iranian threat for if and when a decision should be made, pushing through the 'Iron Dome' and the multilayer interception system," he said.

"And no less important, we secured the nature and depth of the relationship with the US in the operational, political and intelligence spheres."