The site of the Palace of Westminster as a royal residence is thought to date back to the time of Cnut the Great in the 11th century and we know that a palace was built there by Edward the Confessor. Nothing remains of those original buildings but the oldest existing part, Westminster Hall, dates back to the reign of King William II (1087-1100).
In the medieval era, Westminster Palace was the King’s principal residence but a fire and the acquisition of nearby York Place (Whitehall) caused Henry VIII to use it less and less as a residence and more for government – the Houses of Parliament and law courts. The first record of Parliament meeting there was in 1295.