Dayan became Defence Minister just before the 1967 Six-Day War. After the Yom Kippur War of 1973, during which Dayan served as Defense Minister, he was blamed for the lack of preparedness; after some time he resigned. In 1977, following the election of Menachem Begin as Prime Minister, Dayan was expelled from the Labor Party because he joined the Likud-led government as Foreign Minister, playing an important part in negotiating the peace treaty between Egypt and Israel.