Legitimation ceremony in the Kingdom of Hungary
The coronation of the Hungarian monarch was a ceremony in which the king or queen of the Kingdom of Hungary was formally crowned and invested with regalia. It corresponded to the coronation ceremonies in other European monarchies. While in countries like France and England the king's reign began immediately upon the death of his predecessor, in Hungary the coronation was absolutely indispensable: if it were not properly executed, the Kingdom stayed "orphaned". All monarchs had to be crowned as King of Hungary in order to promulgate laws and exercise his royal prerogatives in the Kingdom of Hungary. Starting from the Golden Bull of 1222, all new Hungarian monarchs had to take a coronation oath, by which they had to agree to uphold the constitutional arrangements of the country, and to preserve the liberties of their subjects and the territorial integrity of the realm.
History.
In the Middle Ages, all Hungarian coronations took place in Székesfehérvár Basilica, the burial place of the first crowned ruler of Hungary, Saint Stephen I. The Archbishop of Esztergom anointed the king or queen (however the Bishop of Veszprém claimed many times his right of crowning the queen consort, as an established tradition). The Archbishop then placed the Holy Crown of Hungary and the mantle of Saint Stephen on the head of the anointed person. The king was given a sceptre and a sword which denoted military power. Upon enthronement, the newly crowned king took the traditional coronation oath and promised to respect the people's rights. The Archbishop of Esztergom refused to preside over the coronation ceremony on three occasions; in such cases, the Archbishop of Kalocsa, the second-ranking prelate, performed the coronation. Other clergy and members of the nobility also had roles; most participants in the ceremony were required to wear ceremonial uniforms or robes. Many other government officials and guests attended, including representatives of foreign countries.
According to legend, the first Hungarian monarch, Saint Stephen I, was crowned in the St Adalbert Cathedral in Esztergom on 25 December 1000 or 1 January 1001. After his death he was buried in the Cathedral of Székesfehérvár which he started to build and where he had buried his son Saint Emeric. This cathedral became the traditional coronation church for the subsequent Hungarian monarchs starting with Peter Orseolo, Saint Stephen's nephew in 1038 up to John Zápolya coronation, before the Battle of Mohács in 1526. The huge Romanesque cathedral was one of the biggest of its kind in Europe, and later became the burying place of the medieval Hungarian monarchs.
After the death of King Andrew III, the last male member of the House of Árpád, in 1301, the successful claimant to the throne was a descendant of King Stephen V, and from the Capetian House of Anjou: King Charles I. However he had to be crowned three times, because of internal conflicts with the aristocrats, who were unwilling to accept his rule. He was crowned for the first time in May 1301 by the archbishop of Esztergom in the city of Esztergom, but with a simple crown. This meant that two of the conditions for his legitimacy were not fulfilled. After this, he was crowned for the second time in June 1309 by the archbishop of Esztergom, but in the city of Buda, and with a provisional crown, because the Crown of Saint Stephen was not yet in his possession. Finally, after obtaining the Holy Crown, Charles was crowned for his third time, but now in the Cathedral of Székesfehérvár, by the archbishop of Esztergom and with the Holy Crown.
After the death of King Albert in 1439, his widow, Elizabeth of Luxembourg, ordered one of her handmaidens to steal the Holy Crown that was kept in the castle of Visegrád, and with it she could crown her newborn son as King Ladislaus V. The relevance of the strict conditions from the coronation were fulfilled without questioning, and for example King Matthias Corvinus ascended to the throne in 1458, but he could be crowned with the Holy Crown only in 1464 after he recovered it from the hands of Frederick III, Holy Roman Emperor. Only after this did Matthias start his internal and institutional reforms in the Kingdom, having been considered as the legitimate ruler of Hungary.
When the Kingdom of Hungary was occupied by the Ottoman armies in the decades after the Battle of Mohács in 1526, the following Habsburg monarchs could not reach the city of Székesfehérvár (it lost in 1543) to be crowned. So in 1563 St. Martin's Cathedral in Pressburg (today Bratislava) became the cathedral of coronation and remained so until the coronation of 1830, after which coronations returned to Székesfehérvár, but not to the massive cathedral built by Saint Stephen, because that had been destroyed in 1601 when the Christian armies besieged the city. The Ottomans used the cathedral for gunpowder storage, and during the attack the building was destroyed.
Legal requirements for coronation.
Rulers of Hungary were not considered legitimate monarchs until they were crowned King of Hungary with the Holy Crown of Hungary. As women were not considered fit to rule Hungary, the two , Mary and Maria Theresa, were crowned "kings" (Rex Hungariae) of Hungary.
Even during the long personal union of Austria and the Kingdom of Hungary, the Habsburg Emperor had to be crowned King of Hungary in order to promulgate laws there or exercise his royal prerogatives. The only Habsburg who reigned without being crowned in Hungary was Joseph II, who was called "kalapos király" in Hungarian ("the hatted king"). Before him, John Sigismund Zápolya and Gabriel Bethlen were elected kings, but they were never crowned nor generally accepted, and Imre Thököly was only declared King of Upper Hungary by Sultan Mehmed IV without being elected and crowned.
The final such rite was held in Budapest on 30 December 1916, when Emperor Charles I of Austria and Empress Zita were crowned as King Charles IV and Queen Zita of Hungary. The ceremony was rushed, due both to the war and the constitutional requirement for the Hungarian monarch to approve the state budget prior to the end of the calendar year. Charles IV's coronation was filmed however, and thus remains the only coronation of a Hungarian monarch ever documented in this way.
The Austro-Hungarian Empire dissolved with the end of World War I, although Hungary would later restore a titular monarchy from 1920-46—while forbidding Charles to resume the throne. A communist takeover in 1945 spelled the final end of this "kingdom without a king".
Legal requirements in the Middle Ages.
By the end of the 13th century, the customs of the Kingdom of Hungary prescribed that all the following (three requirements) shall be fulfilled when a new king ascended the throne:
Afterwards, from 1387, the customs also required the election of the new king. Although, this requirement disappeared when the principle of the hereditary monarchy came in 1688. Afterwards, kings were required to issue a formal declaration "("")" in which they swore to respecting the constitution of the kingdom.
The first requirement (coronation by the Archbishop of Esztergom) was confirmed by Béla III of Hungary, who had been crowned by the Archbishop of Kalocsa, based on the special authorisation of Pope Alexander III. However, after his coronation, he declared that his coronation would not harm the customary claim of the Archbishops of Esztergom to crown the kings. In 1211, Pope Innocent III refused to confirm the agreement of Archbishop John of Esztergom and Archbishop Berthold of Kalocsa, on the transfer of the claim. The Pope declared that the Archbishop of Esztergom alone, and no other prelate, was entitled to crown the King of Hungary.
Ceremony.
The Hungarian coronation ritual closely follows the Roman ritual for the consecration and coronation of kings ("De Benedictione et Coronatione Regis") found in the Roman Pontifical ("Pontificale Romanum"). In fact, for the coronation of King Franz Joseph I and Queen Elisabeth, the Roman Pontifical of Clement VII, revised by Benedict XIV, was used rather than the traditional Hungarian ritual.
According to ancient custom just before the coronation proper, the Archbishop of Esztergom handed the Holy Crown to the Count Palatine (Nádor) who lifted it up and showed it to the people and asked if they accept the elect as their king (this is part of the Coronational Ordo of Mainz, which historians like György Györffy theorized that could be the one used). The people responded, "Agreed, so be it, long live the king!" A bishop then presented the king to the Archbishop requesting him in the name of the Church to proceed with his coronation. The Archbishop asked the king three questions—if the king agreed to protect the holy faith, if he agreed to protect the holy Church and if he agreed to protect the kingdom—to each of which the king responded, "I will." 
The king then took the oath, "I, nodding to God, confess myself to be King (N) and I promise before God and his Angels henceforth the law, justice, and peace of the Church of God, and the people subject to me to be able and to know, to do and to keep, safe and worthy of the mercy of God, as in the counsel of the faithful I will be able to find better ones. To the pontiffs of the Churches of God, to present a congenial and canonical honor; and to observe inviolably those which have been conferred and returned to the Churches by Emperors and Kings. To render due honor to my abbots, counts, and vassals, according to the counsel of my faithful."
Then he touches with both hands the book of the Gospels, which the Metropolitan holds open before him, saying:
So God help me, and these holy Gospels of God.
Afterwards the King-elect reverently kisses the hand of the Metropolitan.
The Archbishop then said the prayer:
Almighty and everlasting God, Creator of all things, Commander of angels, King of kings and Lord of lords, who caused your faithful servant Abraham to triumph over his enemies, gave many victories to Moses and Joshua, the leaders of your people, exalted your humble servant David to the eminence of kingship, enriched Solomon with the ineffable gifts of wisdom and peace. Hear our humble prayers and multiply your blessings upon your servant, whom in prayerful devotion we consecrate our king; that he, being strengthened with the faith of Abraham, endowed with the meekness of Moses, armed with the courage of Joshua, exalted with the humility of David and distinguished with the wisdom of Solomon, may please you in all things and always walk without offense in the way of justice. May he nourish and teach, defend and instruct your Church and people and as a powerful king administer a vigorous regimen against all visible and invisible powers and, with your aid, restore their souls to the concord of true faith and peace; that, supported by the ready obedience and glorified by the due love of these, his people, he may by your mercy ascend to the position of his forefathers and, defended by the helmet of your protection, covered with your invincible shield and completely clothed with heavenly armour, he may in total victoriously triumph and by his [power] intimidate the unfaithful and bring peace to those who fight for you, through our Lord, who by the vigor of his Cross has destroyed Hell, overcame the Devil, ascended into heaven, in whom subsists all power, kingship and victory, who is the glory of the humble and the life and salvation of his people, he who lives and reigns with you and the Holy Spirit forever and ever. Amen. 
The king then prostrated himself before the altar as the Litany of the Saints was sung. After this the Archbishop anointed the king on his right forearm and between his shoulders as he said the prayer:
God, the Son of God, Our Lord Jesus Christ, who by the Father was anointed with the oil of gladness above his fellows may He himself by this present infusion of holy anointing pour upon your head the blessing of the Spirit Paraclete to penetrate into the innermost of your heart so that you receive by this visible and material oil invisible gifts and finally having performed the just government of this temporal kingdom, you may merit to reign eternally with Him who alone is the sinless King of Kings, who