Prior to the Roman conquest of Dacia, the territories between Danube and Dniester rivers were inhabited by various Thracian peoples, including the Dacians and the Getae. According to Strabo, the Dacians and the Getae spoke the same language, but in Herodotus's "Histories", the two had different religious backgrounds. Dio Cassius draws attention to the cultural similarities between the two people. Scholars dispute over whether the Dacians and the Getae were the same ethnic group. Roman incursions under Emperor Trajan between 101–102 AD and 105–106 AD resulted in half of the Dacian kingdom becoming a province of the Roman Empire called "Dacia Felix". The Roman rule lasted for only 165 years, though Roman colonists brought the Latin language, which helped create modern Romanian. Roman troops pulled out of Dacia around 271 AD and the territory was invaded by nomadic peoples. Burebista, Decebalus and Trajan are considered the Romanians' forefathers in Romanian historiography.
During the Middle Ages, Romania was divided between three principalities; Wallachia, Transylvania, and Moldavia. The existence of independent Romanian voivodeships in Transylvania as early as the 9th century is mentioned in Gesta Hungarorum, but around two centuries later, Transylvania had largely been annexed by Hungary. In the other parts, many small local states with varying degrees of independence developed, but only under Basarab I and Bogdan I the larger principalities of Wallachia and Moldavia would emerge to fight the invading Ottoman Empire. However, the principalities would lose, and would become autonomous regions of the Ottoman Empire.
During the period of the Austro-Hungarian rule in Transylvania and of Ottoman suzerainty over Wallachia and Moldavia, most Romanians were given few rights, even in territories where they formed the majority of the population. Nationalistic themes became principal during the Wallachian uprising of 1821, and the 1848 revolutions in Wallachia and Moldavia. During this time, the proto-Romanian flag was adopted; a blue-yellow-red horizontal tricolor with the blue meaning liberty, the yellow meaning justice, and the red meaning fraternity. This flag would be adopted as the flag of Romania; albeit mounted vertically. After the failed 1848 revolutions not all the Great Powers supported the Romanians' expressed desire to officially unite in a single state. During the Russo-Turkish War, Romanians fought for independence on the side of the Russian Empire, and in the aftermath was recognized as an independent state by even the Ottoman Empire.
The new Kingdom of Romania underwent a period of stability and progress until 1914, and also acquired Southern Dobruja from Bulgaria after the Second Balkan War. Despite remaining neutral during the first years of the World War, Romania would enter the war after the secret Treaty of Bucharest, according to which Romania would acquire territories with a majority of Romanian population from Austria-Hungary. This would never occur, however, and Romania would experience no territorial changes during and after the war. After initial advances the Romanian military campaign quickly turned disastrous for Romania as the Allies occupied two-thirds of the country within months, and the nearby Russian Civil War forced Romania to exit the war. Today, Romania is a relatively stable, democratic state.