Louis I of Hungary, also known as Louis the Great (; ; ) or Louis the Hungarian (, ; 5 March 1326 – 10 September 1382), was King of Hungary and Croatia from 1342 and King of Poland from 1370 until his death in 1382. He was the first child of Charles I of Hungary and his wife, Elizabeth of Poland, to survive infancy. A 1338 treaty between his father and Casimir III of Poland, Louis's maternal uncle, confirmed Louis's right to inherit the Kingdom of Poland if his uncle died without a son. In exchange, Louis was obliged to assist his uncle in reoccupying the lands that Poland had lost in previous decades. He bore the title Duke of Transylvania between 1339 and 1342 but did not administer the province.

Louis was of age when he succeeded his father in 1342, but his deeply religious mother exerted a powerful influence on him. He inherited a centralised kingdom and a rich treasury from his father. During the first years of his reign, Louis launched a crusade against the Lithuanians and restored royal power in Croatia; his troops defeated a Tatar army, expanding his authority towards the Black Sea. When his brother, Andrew, Duke of Calabria, husband of Queen Joanna I of Naples, was assassinated in 1345, Louis accused the queen of his murder and punishing her became the principal goal of his foreign policy. He launched two campaigns to the Kingdom of Naples between 1347 and 1350. His troops occupied large territories on both occasions, and Louis adopted the styles of Neapolitan sovereigns (including the title of King of Sicily and Jerusalem), but the Holy See never recognised his claim. Louis's arbitrary acts and atrocities committed by his mercenaries made his rule unpopular in Southern Italy. He withdrew all his troops from the Kingdom of Naples in 1351.

Like his father, Louis administered Hungary with absolute power and used royal prerogatives to grant privileges to his courtiers. However, he also confirmed the liberties of the Hungarian nobility at the Diet of 1351, emphasising the equal status of all noblemen. At the same Diet, he introduced an entail system and a uniform rent payable by the peasants to the landowners, and confirmed the right to free movement for all peasants. He waged wars against the Lithuanians, Serbia, and the Golden Horde in the 1350s, restoring the authority of Hungarian monarchs over territories along frontiers that had been lost during previous decades. He forced the Republic of Venice to renounce the Dalmatian towns in 1358. He also made several attempts to expand his suzerainty over the rulers of Bosnia, Moldavia, Wallachia, and parts of Bulgaria and Serbia. These rulers were sometimes willing to yield to him, either under duress or in the hope of support against their internal opponents, but Louis's rule in these regions was only nominal during most of his reign. His attempts to convert his pagan or Orthodox subjects to Catholicism made him unpopular in the Balkan states. Louis established a university in Pécs in 1367, but it was closed within two decades because he did not arrange for sufficient revenues to maintain it.

Louis inherited Poland after his uncle's death in 1370. Since he had no sons, he wanted his subjects to acknowledge the right of his daughters to succeed him in both Hungary and Poland. For this purpose, he issued the Privilege of Koszyce (now Košice in Slovakia) in 1374, spelling out the liberties of Polish noblemen. However, his rule remained unpopular in Poland. In Hungary, he authorised the royal free cities to delegate jurors to the high court, hearing their cases and set up a new high court. Suffering from a skin disease, Louis became even more religious during the last years of his life. At the beginning of the Western Schism, he acknowledged Urban VI as the legitimate pope. After Urban deposed Joanna and put Louis's relative Charles of Durazzo on the throne of Naples, Louis helped Charles occupy the kingdom. In Hungarian historiography, Louis was regarded for centuries as the most powerful Hungarian monarch who ruled over an empire "whose shores were washed by three seas".

Childhood and youth (1326–1342)

Born on 5 March 1326, Louis was the third son of Charles I of Hungary and his wife, Elizabeth of Poland. He was named for his father's uncle, Louis, Bishop of Toulouse, canonised in 1317. The first-born son of his parents, Charles, died before Louis was born. Louis became his father's heir after the death of his brother Ladislaus in 1329.

He had a liberal education by the standards of his age and learned French, German and Latin. He showed a special interest in history and astrology. A cleric from Wrocław, Nicholas Neszmélyi, taught him the basic principles of Christian faith. However, Louis's religious zeal was due to his mother's influence. In a royal charter, Louis remembered that in his childhood, a knight of the royal court, Peter Poháros, often carried him on his shoulders. His two tutors, Nicholas Drugeth and Nicholas Tapolcsányi, saved the lives of both Louis and his younger brother, Andrew, when Felician Záh attempted to assassinate the royal family in Visegrád on 17 April 1330.

Louis was only nine when he stamped a treaty of alliance between his father and John of Bohemia. A year later, Louis accompanied his father in invading Austria. On 1 March 1338, John of Bohemia's son and heir, Charles, Margrave of Moravia, signed a new treaty with Charles I of Hungary and Louis in Visegrád. According to the treaty, Charles of Moravia acknowledged the right of Charles I's sons to succeed their maternal uncle, Casimir III of Poland, if Casimir died without a male issue. Louis also pledged that he would marry the margrave's three-year-old daughter, Margaret.

Casimir III's first wife, Aldona of Lithuania, died on 26 May 1339. Two leading Polish noblemen – Zbigniew, chancellor of Kraków, and Spycimir Leliwita – persuaded Casimir, who had not fathered a son, to make his sister, Elizabeth, and her offspring his heirs. According to the 15th-century Jan Długosz, Casimir held a general sejm in Kraków where "the assembled prelates and nobles"The Annals of Jan Długosz (A.D. 1339), p. 289. proclaimed Louis as Casimir's heir, but the reference to the sejm is anachronistic. Historian Paul W. Knoll writes that Casimir preferred his sister's family to his own daughters or a member of a cadet branch of the Piast dynasty, because he wanted to ensure the king of Hungary's support against the Teutonic Knights. Louis's father and uncle signed a treaty in Visegrád in July whereby Casimir III made Louis his heir if he died without a son. In exchange, Charles I pledged that Louis would reoccupy Pomerania and other Polish lands lost to the Teutonic Order without Polish funds and would only employ Poles in the royal administration in Poland.

Louis received the title of Duke of Transylvania from his father in 1339, but he did not administer the province. According to a royal charter from the same year, Louis's bride, Margaret of Bohemia, lived in the Hungarian royal court. Louis's separate ducal court was first mentioned in a royal charter of 1340.

Reign First years (1342–1345)

Charles I died on 16 July 1342. Five days later, Csanád Telegdi, Archbishop of Esztergom, crowned Louis king with the Holy Crown of Hungary in Székesfehérvár. Although Louis had attained the age of majority, his mother Elizabeth "acted as a sort of co-regent" for decades, because she exerted a powerful influence on him. Louis inherited a rich treasury from his father, who had strengthened royal authority and ruled without holding Diets during the last decades of his reign.

Louis introduced a new system of land grants, excluding the grantee's brothers and other kinsmen from the donation in contrast with customary law: such estates escheated to the Crown if the grantee's last male descendants died. On the other hand, Louis often "promoted a daughter to a son", that is authorized a daughter to inherit her father's estates, although customary law prescribed that the landed property of a deceased nobleman who had no sons was to be inherited by his kinsmen. Louis often granted this privilege to the wives of his favorites. Louis also frequently authorized landowners to apply capital punishment in their estates, limiting the authority of the magistrates of the counties.

William Drugeth, an influential advisor of Louis's late father, died in September 1342. He bequeathed his landed property to his brother, Nicholas, but Louis confiscated those estates. In late autumn, Louis dismissed his father's Voivode of Transylvania, Thomas Szécsényi, although Szécsényi's wife was a distant cousin of the queen mother. Louis especially favored the Lackfis: eight members of the family held high offices during his reign. Andrew Lackfi was the commander of the royal army during the first war of Louis's reign. In late 1342 or early 1343, he invaded Serbia and restored the Banate of Macsó, which had been lost during his father's reign.

Robert, King of Naples died on 20 January 1343. In his testament, he declared his granddaughter, Joanna I, his sole heir, excluding Louis's younger brother, Andrew, Joanna's husband, from becoming co-ruler. Louis and his mother regarded this as an infringement of a previous agreement between the late kings of Naples and Hungary. He visited his bride's father, Charles IV, Holy Roman Emperor, in Prague to persuade him to intervene on Andrew's behalf with Charles's former tutor, Pope Clement VI, the overlord of the Kingdom of Naples. Louis also sent envoys to his Neapolitan relatives and the high officials of the kingdom, urging them to promote his brother's interests. Their mother, Elizabeth, left for Naples in the summer, taking with her almost the whole royal treasure, including more than of silver and of gold. During her seven-month-long stay in Italy, she was only able to persuade her daughter-in-law and the pope to promise that Andrew would be crowned as Joanna's husband.

According to the nearly contemporaneous chronicle of John of Küküllő, Louis launched his first campaign against a group of Transylvanian Saxons, who had refused to pay taxes, and forced them to yield in the summer of 1344. During his stay in Transylvania, Nicholas Alexander of Wallachia – who was the son of Basarab I of Wallachia, the ruling prince of Wallachia – swore loyalty to Louis on his father's behalf in Brassó (now Brașov in Romania); thus the suzerainty of the Hungarian monarchs over Wallachia was, at least outwardly, restored.

Louis joined a crusade against the pagan Lithuanians in December 1344. The crusaders – including John of Bohemia, Charles of Moravia, Peter I, Duke of Bourbon, and William II, Count of Hainaut – laid siege to Vilnius. However, a Lithuanian invasion of the lands of the Teutonic Knights forced them to lift the siege. Louis returned to Hungary in late February 1345. He dispatched Andrew Lackfi, Count of the Székelys, to invade the lands of the Golden Horde in retaliation for the Tatars' earlier plundering raids against Transylvania and the Szepesség (now Spiš in Slovakia). Andrew Lackfi and his army of mainly Székelys warriors inflicted a defeat on a large Tatar army on 2 February 1345. Hungarian warriors were victorious in their campaign, decapitating the local Tatar leader, the brother-in-law of the Khan, Atlamïş, and making the Tatars flee toward the coastal area. The Golden Horde was pushed back behind the Dniester River. Thereafter, the Golden Horde's control of the lands between the Eastern Carpathians and the Black Sea weakened. A conflict between Louis's uncle and father-in-law (Casimir III of Poland and Charles of Moravia) led to a war between Poland and Bohemia in April. In this war, Louis supported his uncle with reinforcements in accordance with the agreement of 1339.