When Wilson suddenly announced his retirement in March 1976, Callaghan defeated five other candidates to be elected Leader of the Labour Party; he was appointed prime minister on 5 April 1976. Despite winning a narrow majority in the House of Commons at the 1974 election, Labour had lost this by the time Callaghan became prime minister, and several by-election defeats and defections in his early months forced Callaghan to strike a confidence and supply agreement with the Liberal Party. While this initially proved stable, in the wake of significant industrial disputes and widespread strikes in the 1978–79 "Winter of Discontent", and the defeat of the referendum on devolution for Scotland, led to minor parties joining the Conservatives to pass a motion of no-confidence in Callaghan on 28 March 1979. Although remaining personally popular in opinion polls, Callaghan led Labour to defeat at the 1979 election and was replaced by Margaret Thatcher.