Andrew II the Jerosolimitan (Hungarian: Jeruzsálemi II András/Endre, Croatian: Andrija I. Slovak: Ondrej) (c. 1177 – 21 September, 1235), King of Hungary and Croatia (1205-1235), Prince of Halych (1188-1189, 1208-1209), Duke of Croatia and Dalmatia (1197-1199, 1200-1203). He was the younger son of King Béla III of Hungary, who invested him with the government of the Principality of Halych. However, the boyars of Halych rebelled against his rule and expelled the Hungarian troops. Following their father's death, Andrew continuously conspired against his brother, King Emeric of Hungary who had to grant him the government of Croatia and Dalmatia. When his brother and his infant son died, Andrew ascended the throne and started to grant royal domains to his partisans. He participated in the Fifth Crusade but he could not achieve any major military success. He was obliged to issue the Golden Bull confirming the privileges of the noblemen of Hungary and later he was also obliged to confirm the special privileges of the clergy. During his long reign, he had several quarrels with his sons.
Nevertheless, when Prince Volodymyr II of Halych, who had been expelled from his country by his subjects, fled to Hungary seeking for assistance in 1188, King Béla III had him arrested and occupied his principality and he invested Andrew with Halych. The child Andrew's rule in Halych must have been only nominal; he even did not visit his principality. Although, the young prince's troops could get the mastery in 1189 when the boyars of Halych rose against his rule, but shortly afterwards Prince Volodymyr II managed to escape from his captivity and he expelled the Hungarian troops from Halych.
On 23 April 1196, King Béla III died and he left the Kingdom of Hungary unportioned to his eldest son, Emeric, while Andrew inherited a large amount of money in order to fulfill his father's Crusader oath. However, Andrew used the money to recruit followers among the barons and also sought the assistance of Leopold V, Duke of Austria. In December 1197, Andrew's troops defeated King Emeric's armies in a battle near to Macsek in December 1197. Following Andrew's victory, the king was obliged to transfer the government of the Duchies of Croatia and Dalmatia to Andrew.
In the beginning of 1198, Pope Innocent III requested Andrew to fulfill his father's last will and lead a Crusade to the Holy Land. However, instead of a Crusade, Andrew made a campaign against the neighbouring provinces and occupied Zahumlje and Rama. Andrew also went on conspiring with some prelates against his brother, but King Emeric was informed on Andrew's plans and he personally arrested Bishop Boleszlo of Vác, one of Andrew's main supporters, and he also deprived his brother's followers (e.g., Palatine Mog) of their dignities. In the summer of 1199, King Emeric defeated Andrew in the Battle of Rád and Andrew had to fleed to Austria. Finally, the two brothers made peace with the mediation of the Papal Legate Gregory, and the king granted again the government of Croatia and Dalmatia to his brother.
Around 1200, Andrew married Gertrude, a daughter of Berthold IV, Duke of Merania. It was probably his wife who persuaded him to conspire against his brother again, but when King Emeric, who had realised that Andrew's troops outnumbered his armies, went unarmed, wearing only the crown and the sceptre, to Andrew's camp near Varasd, Andrew surrendered voluntarily on the spur of the scene. The king had his brother arrested, but Andrew managed to escape shortly afterwards.
Nevertheless, the king become more and more ill, and wanted to secure the ascension of his young son, Ladislaus, who had been crowned on 26 August 1204. Shortly afterwards, the king reconciled with Andrew whom he appointed to govern the kingdom during his son's minority. After his brother's death on 30 September/November 1204, Andrew took over the government of the kingdom as his nephew's tutor and he also seized the money his brother had deposited on behalf of the child Ladislaus. The Dowager Queen Constance was anxious about her son's life and she escaped with King Ladislaus to the court of Leopold VI, Duke of Austria. Andrew made preparations for a war against Austria, but the child king died on 7 May 1205, thus Andrew inherited the throne.
In 1208, taking advantage of the quarrel between Prince Roman Igorevych and his boyars, Andrew occupied Halych and appointed a regent to govern the principality in his name, but Prince Volodymyr III Igorevych managed to reconquer his principality already in the following year.
A group of the aristocrats of his court, scandalised by Andrew's generosity towards his wife's relatives and followers, planned to offer the throne to his cousins, who had been living in the court of the Emperor Theodore I Lascaris of Nicea, but their envoy was arrested and Andrew could overcome the conspiracy. In 1211, he granted the Burzenland to the Teutonic Knights in order to ensure the security of the southeastern borders of his kingdom against the Cumans. However, the Teutonic Knights began to establish a country independent of the King of Hungary.
In 1211, Andrew provided military assistance to Prince Danylo to reoccupy Halych. Moreover, in the following year, Andrew lead his armies personally to Halych to repulse the attack of Prince Mstilav of Peresopnytsia against Prince Danylo. Shortly afterwards, Prince Danylo, was obliged to leave his country and he sought again Andrew's assistance. Andrew left for his campaign in the summer 1213 when he was informed that a group of conspirators had murdered his queen on 28 September and he had to return.
Following his return, he ordered the execution only the leader of the conspirators and he forgave the other members of the group, which resulted in the emerging antipaty of his son, Béla. Nevertheless, in 1214, Andrew had his son crowned.
In the summer of 1214, Andrew had a meeting with Grand Duke Leszek I of Poland and they agreed that they would divide the Principality of Halych between Hungary and Poland. Their allied troops occupied the neighbouring principality which was granted to Andrew's younger son, Coloman. However, Andrew denied to transfer the agreed territories to Duke Leszek I who made an alliance with Prince Mstilav of Novgorod and they drove away Andrew's troops from the principality.
Shortly afterwards, Andrew made an alliance again with Leszek I and they occupied Halych where again Andrew's son was appointed to prince.
In February 1215, Andrew married Yolanda, the niece of Henry I, the Emperor of Constantinople. When the Emperor Henry I died on 11 July 1216, Andrew was planning to acquire the imperial throne, but the barons of the Latin Empire proclaimed his father-in-law, Peter of Courtenay their emperor.
Nevertheles, Andrew decided to fulfill his father's oath and made preparations for a Crusade. He agreed with the Republic of Venice to undertake the delivery of his troops to the Holy Land, in exchange he renounced the supremacy over Zára on behalf of the Republic. Andrew and his troops embarked on 23 August 1217 in Spalato. They landed on 9 October on Cyprus from where they sailed to Acre. The well-mounted army fought on the Jordan River on November 10, 1217 but had fruitless assaults on the fortresses of the Lebanon and on Mount Tabor. Afterwards, Andrew spent his time collecting alleged relics.
Andrew set home on (January 18, 1218). On the way home, he negotiated with King Levon I of Armenia, the Emperor Theodore I Laskaris of Nicaea and Tsar Ivan Asen II of Bulgaria and arranged several marriage contracts between his children and the courts he visited. When he was staying in Nicaea, his cousins, who had been living there, made an unsuccessful attempt to take his life.
His foreign policy was also a total failure. In August 1219, his younger son, Coloman, who had been crowned King of Halych, was expelled from his kingdom by Prince Mstilav of Novgorod. Andrew had to make peace with the Prince of Novgorod and he also engaged his youngest son, Andrew with one of his opponent's daughter.
In the beginning of 1222, the discontent serviens (nobles) came to Andrew's court in large numbers, and they persuaded the king to issue the Golden Bull which confirmed their privileges, including the right to disobey the King if he acted not in line with the provisions of the Golden Bull (ius resistendi).
In 1223, the junior King Béla IV took back his wife and escaped to Austria fearing of Andrew's anger. Finally, Andrew made an agreement with his son with the mediation of Pope Honorius III and the junior king took over again the government of Slavonia, Dalmatia and Croatia. On 6 June 1224 Andrew made a peace with Duke Leopold VI of Austria.
In 1224, Andrew issued the Diploma Andreanum which unified and ensured the special privileges of the Transylvanian Saxons. In the same year, Andrew expelled the Teutonic Knights from Transylvania because they had ignored his overlordship.
In the second half of 1226, Andrew lead his armies to Halych on the request of his youngest son, Andrew. Although, Prince Mstilav defeated the royal armies, but finally he agreed to cede the government of the principality to the Hungarian prince.
During 1228, Andrew's two sons started again to take back the former royal domains in their provinces, and they persuaded Andrew to confiscate the estates of the barons who had taken part in the conspiracy against their mother. In 1229, Prince Danylo of Halych expelled Andrew's youngest son from his principality, while Frederick II, Duke of Austria started to attack the western borders of the kingdom in 1230.
In the second half of 1231, Andrew lead his armies to Halych and managed to ensure his youngest son's rule in the principality. On his return to Hungary, Archbishop Robert of Esztergom took his kingdom under interdict and excommunicated the king's major dignitaries because Andrew insisted on the employment of Jews and Muslims in his administration. Nevertheless, upon Andrew's request, the Archbishop withdrew the ecclesiastic punishments soon and the Pope promised that the dignitaries of the King of Hungary would never be excommunicated without his special authorization.
On 20 August 1233, Andrew had a meeting with the legate of Pope Gregory IX in the woods of Bereg, and they made an agreement which ensured the privileges of the clergy. In the autumn of the year, he also met with Duke Frederick II of Austria and they agreed to stop the skirmishes on the border, but the Duke soon broke the agreement.
In the summer of 1234, the Bishop John of Bosnia excommunicated Andrew because he had not respected some provisions of the Agreement of Bereg. Andrew appealed to the Pope against the bishop's measure. In the autumn of 1234, Prince Danylo laid siege to the capital of Andrew's youngest son who died during the siege. Thus, the Hungarian supremacy over Halych disappeared.
In the beginning of 1235, Andrew made a campaign against Austria and enforced Duke Frederick II to make a peace.
He was still alive when one of his daughters, Elisabeth, who had died some years before, was canonized on 28 May 1235. Before his death, he was absolved from the excommunication; moreover, the Pope also promised that the King of Hungary and his relatives would not be excommunicated without the special permission of the Pope.