British overseas territory with a flag bearing a red castle (9)
I believe the answer is:
gibraltar
(Other definitions for gibraltar that I've seen before include "Mediterranean port" , "Colony on rock" , "Fortified rock-headland at southern tip of Spain" , "Great rock at south of Spain" , "UK territory" .)