Israel's ex-premier, Benjamin Netanyahu, announced Tuesday that he accepts Prime Minister Ariel Sharon's offer to serve as foreign minister until early elections are held in February.

Netanyahu's announcement came just hours after Sharon dissolved parliament and decided to go to elections because of his failure to restore his majority in parliament.

Netanyahu is Sharon's main rival for leadership of the right-wing Likud Party. The party is scheduled to hold primaries in coming weeks, and Netanyahu said he would challenge Sharon. The winner would lead the party into the February election.

Netanyahu said he accepted Sharon's offer because Israel is in a crisis.

"We know that we are in the toughest security situation, we know we are on eve of war in Iraq ... I told the prime minister right now that I am willing ... to take on the position of the foreign minister," Netanyahu told a news conference.