Dvigrad was first mentioned in 879, when it fell under the rule of the Patriarch of Aquileia. However, it had existed long before it as a part of the Roman province settlement. Its name speaks originally of two towns. Today's ruins are the remains of the northern town of Moncastello, while the other one, Castel Parentino, was abandoned in the 10th century.
Dvigrad fell under the rule of the Counts of Gorizia, it was destroyed by the Genoese fighting against the new owners, the Venice. Many lives and towns were lost in this war, which mainly took place in Istria. It is most likely that Parentino was abandoned at that time, and Montecastello was solely renovated. Following more than a century of peace, the second half of the 16th century was marked by a continuous conflict between Venice and Austria. This is the time of the plague epidemics, followed by the malaria. In 1630, inhabitants had left the town and moved to Kanfanar. Only the poorest family remained in Dvigrad. It was noted that in 1650, the Bishop blessed only three families in Dvigrad. Some twenty years later, the Church of St. Sophia was also abandoned and the time has taken its toll.
Current remains represent a well preserved, typical medieval town castle. It is encircled by the two rings of town walls connected by the town gate, of which there are three just as many as its defensive towers. The Church of St. Sophia still dominates the town. It is located on the highest point of town, on the same location from the Early Christian times. It current fascinating three-nave form was built in the 13th century. In front of this Romanesque style edifice there is the main town square and the town palace. Military quarters were located in the town's western part, while the craftsmen inhabited its southwest. The remaining, rather a large area, was occupied by houses for regular citizens.