Late Medieval Hungary
Hungary fell on hard times in 1241 AD, when the Mongols invaded Eastern Europe from Central Asia. The Mongols brought with them a new invention: gunpowder from China. Poland, Russia and Hungary all fell under the control of the Mongol Empire. Thousands of people died in the battles. Hungarian people had to spend most of the next fifty years defending themselves against Mongol raids, which was very expensive. To get more people, and also more money, the kings of Hungary encouraged Jewish people from all over Europe to move to Hungary (even though the Golden Bull had been mean to Jewish people).
Elizabeth of Poland and her sons
But by 1300 AD, the Mongol Empire was mostly leaving Europe alone, and Hungary grew rich and powerful again. A new dynasty ruled Hungary under King Charles I, a great-grandson of Louis VIII of France. Charles built alliances with his neighbor, the Holy Roman Empire. He also married Elizabeth, whose brother Casimir was the king of Poland. Charles died in 1342, and Elizabeth ruled after him in cooperation with their teenage son Louis. When the Black Death killed Louis' young wife, Elizabeth found a new wife for him: another Elizabeth. Elizabeth promoted the interests of Hungarian women, helping them to inherit their fathers' property. She opened many Franciscan monasteries in Hungary. Under their influence, she expelled all Jewish Hungarians from Hungary in 1360, though they returned four years later. When Casimir died in 1370, Elizabeth added Poland to her domains, ruling most of eastern Europe from Lithuania in the north-east to northern Italy in the south-west. In 1375, when she was 70 years old, Elizabeth retired to a monastery, where she died five years later. Her son Louis died two years after her.
Louis I of Hungary (1370 AD)
Louis had no sons, and his 43-year-old widow Elizabeth split his kingdom between their two daughters (Elizabeth's granddaughters), who were only ten and eleven years old. Jadwiga got Poland, and Elizabeth ruled Hungary as regent for Mary. Elizabeth was an educated woman - she wrote a book for her daughters - and she surrounded herself with smart, educated assistants, pushing out powerful but uneducated men. These men conspired against Elizabeth, but she defeated rebellions and kept power for five years before being captured and strangled to death by her enemies. By this time Mary was sixteen. In 1385 she married the son of the Holy Roman Emperor, Sigismund, who supported her right to the throne: the two ruled together, fighting off rebellions, until Mary died (of problems with a pregnancy) ten years later; then Sigismund ruled Hungary alone. He led a coalition that fought off an attack by the Ottoman sultan Bayezid the following year (mainly thanks to Timur attacking the Ottomans from the other side). After that, Sigismund got more and more power, becoming Holy Roman Emperor in 1414. His second wife, Mary's cousin Barbara, became regent of Hungary for him.
Sigismund died in 1437, and Barbara's daughter, a third Elizabeth, inherited power with her husband, but he died two years later, and Elizabeth ruled alone. But from 1446 on, Hungary faced a new threat: invasions by the Ottoman sultans. The Hungarians needed a great general to lead them, and instead of the king, their real ruler was John Hunadi, a great general who spent most of his time fighting off more and more serious Ottoman attacks. Hungary went back and forth between independence and being part of the big Polish-Lithuanian empire, which controlled pretty much all of eastern and central Europe.
But in 1526, under their sultan Suleiman the Magnificent, the Ottoman Empire, which had conquered the last bit of the Roman Empire in Constantinople, went on to attack Hungary. The Ottomans won a big battle there. The king of Hungary and Bohemia, Louis II, was killed in the battle, and the Ottomans took over the eastern half of Hungary. Suleiman lost his battle with the Austrians - Hungary's neighbor to the west - three years later, so the Austrians were able to take over the western half of Hungary. That was the end of Hungary as an independent country for a long time.