Segorbe Castle was an Arabian alcázar (palace or castle). Very little remains of the original alcázar, but the large complex was a residence of lords, dukes and kings for over a millennium.
.After the Muslim king of Valencia, Zayd Abu Zayd, converted to Christianity and declared himself an ally and vassal of King James I of Aragon, he ceded the fortress to James in 1229 and became governor general of Valencia on his behalf. The castle became a sanctuary for Zayd Abu Zayd himself when he was killed by Dynamil Zayyan until James captured the castle in 1245, and placed Abu Zayd in command of an army to assist in the retaking of Valencia.
The castle had a peak in the 14th and 15th centuries, culminating in the holding of General Courts by King Martin of Aragon, who had made the city his residence.
In 1784, urban expansion of Segorbe beyond the original medieval fortifications required further construction, and new walls were built. After the works were completed, the new walls had eight gates.
References:Herceg Novi was founded (on a former small fishing village, existing since Roman Empire times) as a fortress in 1382 by first Bosnian King Stjepan Tvrtko I and was called Sveti Stefan or Castelnuovo. The Turks conquered Herceg Novi in 1482, and ruled for 200 years, until 1687. However, there was a short pause between 1538 and 1539 when it was held by the Spaniards before they were defeated in the Siege of Castelnuovo. Turkey ruled again until 1687, from then until 1797, the town was ruled by the Venetian Republic.
The Herceg Novi old town is amazing. It is on a fairly steep hill that leads all the way down to the sea. Wandering through the small stairways to the various plazas and fortresses is a many hour adventure.