From 2001 to 2009, Livni served in the cabinets of Ariel Sharon and Ehud Olmert, most notably as Israel's Foreign Minister, during which time she led multiple rounds of peace talks with the Palestinians. In September 2008, Livni prepared to take office as Prime Minister of Israel, but the political climate in the country prevented her from forming a government. The following year, she led her party to win a plurality of seats in the Knesset, but was again blocked from becoming prime minister, due to the rightist parties' majority in the Knesset. Consequently, she served as Leader of the Opposition from 2009, until her resignation from the Knesset in 2012.