In 1089, the Croatian king Dmitar Zvonimir died without an heir (his son Radovan died in 1083). King Zvonimir was married to the Hungarian princess and sister of the Hungarian king Ladislav I. After Zvonimir’s death, Stjepan II. came to the Croatian throne (nephew of King Zvonimir), but he soon fell ill and died in 1091. With this, the Croatian royal line died out in the male line, and great turmoil and unrest occurred in Croatia.
As the main contender for the Croatian throne, the Hungarian king Ladislav I. has now appeared as the brother of Zvonimir’s wife Jelena “The Beautyfull”. However, the Croatian nobility did not want that and they started looking for a new king among themselves. A few years after Petar Snačić was elected as a new Croatian king.
In the meantime, at the invitation of his sister, Ladislav had already broken into Croatia and captured Sclavonia (northern Croatia) without any problems, but he could no longer continue militarily. At the same time, the Byzantine emperor Alexius I. Komnenus feared for his possessions in Dalmatia, so he paid the Cumans to invade Hungary from the East, thus forcing Ladislav to return.
After returning to Hungary, Ladislav placed his nephew Almos as a special Croatian king in the conquered area between the Drava and Sava as a sign that he had no intention of annexing the region, as well as the rest of the Kingdom of Croatia and Dalmatia, to the Kingdom of Hungary. In order to consolidate power in Slavonia and connect it even more strongly with Hungary, he founded the Zagreb diocese in 1094, to which the Czech named Duh was dedicated as the first bishop and subordinated the entire territory of the then Sclavonia to it. However, Ladislav never realized his plans completely because he died in 1095, and his nephew Colloman succeeded him to the Hungarian throne at his request.
In 1097, Colloman invaded Croatia, where the Croatian army was severely defeated on Mount Gvozd, and the last Croatian king, Petar Snačić, was killed. Due to Cuman’s re-invasion of Hungary and later the civil war when his brother Almos rebelled against Colloman, he failed to fully dedicate himself to the situation in Croatia, where there was still great resistance to the Hungarian king. Instead of militarily, Colloman tried to get Croatia by agreement with the Croatian nobility. In 1102. he descended to Biograd where a meeting was held. After long negotiations, the Croatian nobility decided to recognize Colloman as king, so Croatia entered into a personal union with Hungary (2 kingdoms connected by the person of the ruler). In return, Colloman undertook not to touch their possessions and to respect the noble privileges and rights of the Kingdom of Croatia. This means that the convening of the Croatian-Dalmatian and Slavonian parliaments continues, as well as the retention of the ban service and the separate coronation of future rulers for the Croatian king. With this agreement, the Croats undertook military assistance to the king up to the borders of Croatia at their own expense, and outside the borders at his expense. In the same year, Colloman was officially crowned Croatian king in Biograd.
In 1104, Alexius I. Komnenus married his son and heir John II. for the Hungarian princess Irena (daughter of Ladislav I.) and decided to leave the Dalmatian cities to Colloman. In 1105. Colloman descended on Dalmatia and besieged Zadar, but after a few days the city surrendered. Other cities and islands soon surrendered, and Colloman completely took control of Dalmatia. After that, a council of all Dalmatian cities was convened, where the king, Hungarian secular and spiritual dignitaries, and the army took an oath to respect the autonomy of Dalmatian cities. On that occasion, Dalmatian cities were given privileges, which were almost identical, but only a transcript of the „Trogir diploma“ has been preserved.
The king guaranteed the cities lasting peace, that is a legal order and legal security, without paying a special tax. The cities themselves could choose a duke and a bishop, and the king only needed to confirm them. He confirmed to them that they could live by the previous rules and laws, and that they could change them freely. They thus gained the autonomy of the judiciary. Colloman got 2/3 of the income from the traffic in the port, and 1/3 went to the city duke. 1/3 of the total amount belonged to the bishop. The king undertook not to allow foreigners or Hungarians to settle in the city without the express consent of the citizens, and freed them from the trespass, that is to host the king and his entourage when he comes to their city, unless a city accepts it. Citizens had the freedom to move. In the end, the king allows those whose rule would become too difficult for them to go freely with his family and property wherever they wish.
This marked the end of Colloman’s conquest of Croatia, and the Hungarian dynasty of Arpad came to the Croatian throne, whose kings would ruled Hungary and Croatia until 1301, when King Andrew III. died.