What was original use of the Louvre?

The Louvre was originally built in the late 12th century as a fortress to protect Paris from invaders. It was later used as a royal residence and a prison, before being converted into a museum in 1793.
Copyright Wanderlust World © https://www.ynyoo.com