The first Palace of Westminster was erected on this site by Edward the Confessor in 1042 and the building was a royal residence until a devastating fire in 1512. After this, the palace became the two-chamber Parliament for government - the House of Lords and the elected House of Commons. Following a further fire in 1834, the palace was rebuilt by Sir Charles Barry and decorated by A W Pugin.