1809, 26 days after he left office, and Neville Chamberlain, who died in 1940, 183 days after he left office, of a cancer that was undiagnosed at the time of his resignation. Assassination and attempts Spencer Perceval is the only British prime minister to have been assassinated. Lord Liverpool, Robert Peel, Margaret Thatcher, and John Major survived targeted assassination attempts in 1820, 1843, 1984, and 1991 respectively while in office, while Edward Heath survived one in 1974 after he had been ousted from office. Died while immediate successors were in office Nine former prime ministers have died while their immediate successors were in office: The Duke of Portland — died during Spencer Perceval's term Robert Peel — died during Lord John Russell's first term Lord Aberdeen — died during Lord Palmerston's second term Benjamin Disraeli — died during William Ewart Gladstone's second term William Ewart Gladstone — died during Lord Salisbury's third term Lord Salisbury — died during Arthur Balfour's term Henry Campbell-Bannerman — died during H. H. Asquith's term Bonar Law — died during Stanley Baldwin's first term Neville Chamberlain — died during Winston Churchill's first term All of the above-listed prime ministers were older than their immediate successors. The Duke of Portland and Lord Aberdeen are the only ones among this list whose immediate successors also died in office. Armed forces veterans The earliest prime minister to be an armed forces veteran was Henry Pelham (1743–1754), who had served as a volunteer soldier in James Dormer's Regiment of Dragoons during the Jacobite rising of 1715 and fought at the Battle of Preston that year against the Jacobite forces. The most recent prime minister to be an armed forces veteran was James Callaghan (1976–1979), who served in the Royal Navy in the Second World War, from 1942 to 1945, seeing action with the East Indies Fleet and reaching the rank of Lieutenant. He was the only future prime minister to serve in the navy rather than the army. In contrast to many nations, Britain has had only two prime ministers who have been military generals: Lord Shelburne (1782–1783), who was promoted from Lieutenant-General to full General in the British Army in the latter year, and the Duke of Wellington, who achieved the supreme rank of Field Marshal in 1813. He was prime minister twice, in 1828–1830 and 1834, in the interval between his two terms as Commander-in-Chief of the