The Castle of Guimarães is the principal medieval castle in the municipality Guimarães, in the northern region of Portugal. It was built under the orders of Mumadona Dias in the 10th century to defend the monastery from attacks by Moors and Norsemen.