King Stjepan Držislav proclaimed his eldest son Svetoslav Suronja as co-ruler and his successor while he was still alive. After the king’s death (probably in 997), Svetoslav I. became Croatian king, with the proviso that, according to the old Slavic custom, he should share power with his brothers Krešimir and Gojslav, who would rule everyone in their part of the country.
Yet it seems that disagreements soon arose between the brothers which eventually resulted in a military conflict. Although their father Stjepan Držislav was an ally of Byzantium in the wars against the Bulgarian emperor Samuel, Krešimir and Gojslav turned to Samuel for help in order to remove Svetoslav from power. In 998, Samuel invaded Croatia with a large army and occupied Bosnia and parts of Dalmatia. He handed over the conquered territories to Krešimir and Gojslav, to which they vowed an alliance with Bulgaria instead of Byzantium.
In this time, Venice also got involved in the conflict. They restored good relations with Byzantium and, as early as 992, Venice enjoyed a privileged trade with them which led to a significant income of money and goods. They also, at that time, strengthened its position by an alliance with the emperor of the Holy Roman Empire. Their political power was growing considerably. In 996. under the doge Peter II. Orseolo, Venice decided to stop paying the Croats the “usual tribute” (solitus census) for free navigation on the Adriatic.
In 999, the Venetian fleet attacked Zara (Zadar) and occupied it. By the end of year 1000. most of the islands were occupied, as well as Split, Trogir and Biograd (then the royal capital). In 1000, king Svetoslav fled to Venice, where he lived for the rest of his life. He married his son Stjepan to the doge’s daughter Hicela. They lived in Venice until 1024. when they fled to Hungary due to the civil war. With the help of the Hungarian king, Stjepan penetrated and conquered Sclavonia (northern Croatia) in 1027. The later Croatian king Dmitar Zvonimir (1075.-1089.) probably came from this royal branch.
In the beginning of the 11th century, Bulgarian military power began to weaken. At that time the Byzantine emperor Basil II. inflicted a series of defeats on them, and in June 1014. they suffered a final heavy defeat at the Battle of Cleidon. The revenge was terrifying. Basil II. got blinded about 15,000 bulgarian prisoners and sent them back to Samuel, who retreated to Prilep. Shocked, Samuel died in October 1014, probably of a heart attack. Until 1018. Basil II. managed to break any further resistance and take power in Bulgaria and Serbia. After 400 years the borders of the Byzantine Empire were moved to the Danube again.
After the escape of Svetoslav, Croatia was ruled together by Krešimir III. and Gojslav. They tried to regain the coastal towns, but without success. After the collapse of the Bulgarian Empire in 1018, they were forced to defer to Basil II. and became his vassals, subjected to Byzantium and without real power. Gojslav died around 1020, and Krešimir III. ruled until about 1030. He was succeeded by his son Stjepan.