 In 879, under duke Branimir, the duke of Croats, Dalmatian Croatia received papal recognition as a state from Pope John VIII.Tomislav was the first ruler of Croatia who was styled a king in a letter from the Pope John X, dating kingdom of Croatia to year 925.Tomislav defeated Hungarian and Bulgarian invasions, spreading the influence of Croatian kings.