The original castle is from 1640, which was destroyed and rebuild. In the civil war (1936-1939) it was a very important piece to defend the city. After the civil war it was used as a prison were a lot left wing Catalans were prisoned.
http://maps.live.com/default.aspx?v=2&cp=41.363957~2.164156&style=o&lvl=1&tilt=-90&dir=0&alt=-1000&scene=12561375&encType=1