The Bedchamber crisis was a constitutional crisis that occurred in the United Kingdom between 1839 and 1841. It began after Whig politician William Lamb, 2nd Viscount Melbourne declared his intention to resign as Prime Minister of the United Kingdom after a government bill passed by a very narrow margin of only five votes in the House of Commons. The crisis occurred very early in the reign of Queen Victoria and involved her first change of government. She was partial to Melbourne, and resisted the requests of his rival Robert Peel to replace some of her ladies-in-waiting, who were primarily from Whig-aligned families, with Conservative substitutes as a condition for forming a government. Following a few false moves toward an alternative Conservative prime minister and government, Melbourne was reinstated until the 1841 election, after which Peel was appointed Prime Minister and Victoria conceded to the replacement of six of her ladies-in-waiting.