The Kingdom of Croatia, or Croatian Kingdom, was a medieval kingdom in Southern Europe comprising most of what is today Croatia, as well as most of the modern-day Bosnia and Herzegovina. The Croatian Kingdom was ruled for part of its existence by ethnic dynasties, and the Kingdom existed as a sovereign state for nearly two centuries. Its existence was characterized by various conflicts and periods of peace or alliance with the Bulgarians, Byzantines, Hungarians, and competition with Venice for control over the eastern Adriatic coast. The goal of promoting the Croatian language in the religious service was initially introduced by the 10th century bishop Gregory of Nin, which resulted in a conflict with the Pope, later to be put down by him. In the second half of the 11th century Croatia managed to secure most coastal cities of Dalmatia with the collapse of Byzantine control over them. During this time the kingdom reached its peak under the rule of kings Peter Krešimir IV (1058–1074) and Demetrius Zvonimir (1075–1089).