In terms of the countries which have gone the longest time with their current governments and borders (barring foreign occupation during wartime), the oldest countries in Europe are as follows:
To use an example from another continent, the region in which modern China is located can trace its dynastic history back to the 17th century BC. However, the region was unstable, with governments frequently fracturing into several smaller states before being reunified again. As such, historians often debate whether modern China was established in 220 BC (when emperor Qin Shi Huang took power), 1912 (when the final imperial government dissolved and was replaced by the democratic Beiyang government), 1928 (when the Chinese Communist Party took power), or 1949 (when the civil war between the CCP and Beiyang governments ended).
The oldest country in Europe varies depending upon one's definition of the terms "oldest" and "country". For example, most current sources define a country's age as the date its current iteration obtained sovereignty (its independence day). However, if one instead chooses to define a country's age by another indicator, such as the date its culture was first established, the date of its earliest known organized government, or the date when its borders were finalized, the list changes significantly. The rankings are also shuffled if one interprets the term "oldest" as meaning the average age of the country's inhabitants rather than the age of the country itself.
The argument is occasionally made that Bulgaria is the oldest country in Europe. While San Marino (est. 301 CE) is undeniably older, it is also one of the smallest countries in the world, essentially a city completely enclosed by Italy, with a total area of 60 km²/24 mi² (for comparison, the entire city of San Francisco's area is 121 km²/46.9 mi²). This disqualifies San Marino in the eyes of some.
Bulgaria, by comparison, is a more traditionally sized country at 110,900 km²/ 42,819 mi² and was established around 681 CE, well before any other modern country. At that time, the Proto-Bulgarian people, led by Khan Asparuh, crossed over the Danube River and established their own state, which was officially recognized in 681 CE. Why then is Bulgaria not listed by most sources as the oldest or second-oldest country in Europe? This original Bulgarian empire was conquered and dismantled during the early 11th century, regained its freedom in the late 12th century (1185 CE), and was then conquered in 1396 by the Ottomans, who ruled it for roughly 500 years. As such, while the name and much of the culture have remained consistent since 681, modern Bulgaria was not established until 1898.
Portugal is another of the oldest countries in Europe. Modern Portugal officially transitioned from a county (of León, now part of Spain) to a sovereign country in 1143, following Alfonso I of Portugal's victory over his cousin, Alfonso VII of León, in the Battle of Valdevez, which resulted in the Treaty of Zamora. Although it has had a hand in ruling other territories (such as Brazil), was partly occupied by Napoleon-led France during the Peninsular War from 1807-1811, and transitioned from a monarchy to a democracy, Portugal has remained a stable country since its establishment.
Denmark is somewhere between the first- or third-oldest country in Europe, depending upon one's classification of San Marino and which Danish founding date is chosen. The birthplace of much Viking culture, the region now known as Denmark was first consolidated between 700-800 CE, and declared a Christian nation in 965 CE. Since that time, Denmark has expanded its territory on multiple occasions, such as its first 100 years of existence, when it briefly occupied portions of what are now the United Kingdom and Norway, but always contracted back to its traditional boundaries.
Critics of Denmark's rank among Europe's oldest countries could point to the country's participation in the Kalmar Union, which politically merged Denmark, Norway, and Sweden into a single kingdom, ruled by Denmark's monarch, from 1387 to 1439 and again from 1440 onward. However, the countries were never fully integrated and began to revert in 1448, becoming largely independent of one another long before they officially re-separating in 1521 (Sweden) and 1814 (Norway).
France is also one of the oldest countries in Europe. France has a unique history, but its origin is traditionally traced back to 843 AD, when the Treaty of Verdun established West Francia, which evolved into the Kingdom of France in 987. France's borders have fluctuated at various times, most notably when sandwiched between the Holy Roman and Angevin Empires during the 1100s and the Napoleonic Wars of the early 1800s. France was also occupied by Nazi Germany during World War II before being liberated by the Allies, led by the United States and the British, in 1944.
The United Kingdom is not as old as one might assume, though the reason for this misconception is arguably a technicality. Although three of the four countries that make up the UK were founded more than a century ago—England (927 CE), Scotland (843), and Wales (1057)—the modern Kingdom of Great Britain was not formed until 1707, when England (which had already incorporated Wales) and Scotland merged. The kingdom would expand in 1801 with the addition of Ireland, which would split into Northern Ireland (which remained with the UK) and Ireland (which became independent) in 1921, in the aftermath of World War I.
San Marino is said to be the oldest country in Europe. The country was established in 301 CE.