Dublin Castle is the historical heart of the city. Built in the 13th century by King John of England. It served as a military fortress, a prison, treasury, court of law.