In the mid-1800s the Romanian serfs in Transylvania joined forces with Austria to fight against the ruling Hungarian land owners, which escalated quickly, but was also ended quickly. This led to the flooding of the area with Hungarians and these events continue to fuel resentment on both sides of the Romanian-Hungarian border today. Meanwhile, conditions in the south and east were improving and in 1878 Romania was recognized as an independent country.
World War I was a huge success for the Romanians. At the outbreak, they declared war on Austria-Hungary in order to win back Transylvania. In the post-war peace talks, Romania gained not just Transylvania, but also Bessarabia and Bucovina.
At the outbreak of World War II, Romania sided with France, Greece, and a number of other countries in the alliance, however with the quick German advance, Romania lost nearly all of their allies, leading to their allowance of the German troop onto their soil in order to prevent further damage. The next logical step was an alliance with Nazi Germany, especially since the Soviets had taken Bessarabia back and, with German assistance, the Romanians could easily recapture it. In 1944 however, the Romanians switched sides once more and formed an alliance with the Soviets to prevent further damage as the Soviet swept across their country.
After the war, a communist government was installed in Romania, which remained loyal to the Soviets only until the late 1950s when Romania gained more independence from the Soviets than any other Eastern European communist country other than Yugoslavia. However, the western leaning politics did little to ease the poverty in the country and in 1989 the people overthrew and killed their leader, Nicolae Ceausescu.