Palais du Louvre (château)
Le Louvre wasn’t always a museum
Originally a fortress
it became a royal palace in the fourteenth century under Charles V
Used from time to time by the kings of France as their main Paris residence.
Its present structure has evolved in stages since the 16th century.
In 1793 part of the Louvre became a public museum,
now the Musée du Louvre has expanded to occupy most of the buildings
https://en.wikipedia.org/wiki/Louvre_Palace
The medieval Louvre
https://www.louvre.fr/en/histoirelouvres/history-louvre/periode-4#tabs