Nitra (pronounced nee-tra) is one of Slovakia's oldest towns dating from the year 828. Prince Pribina (for whom Pribina Square is named for), who was of Slavic ancestry, invited the Archbishop of Salzburg to what was then known as Nitrava to consecrate a church there, and that began over a millennium of the town of Nitra being the religious heart of Slovakia.
After Prince Pribina was expelled from Nitra, the town suffered from many centuries of foreign occupation and wars starting with the Hungarians and Bavarians at the beginning of the 10th century, but this occupation made Nitra thrive instead of fail. It was during this time that Nitriya (the Hungarian spelling of Nitra) became the seat for the Bishop of Nitra, a free town, and the county administrative seat.
Corruption and wars with the Tartars and other groups caused Nitriya to disintegrate during the 13th century, and by 1288, Nitra was owned by the bishops and lost its status as a free town. Matus Cak, a Slovak magnate, ran Nitra for a short time until his death in 1321, and the burghers who lived in the Upper Town lost privileges and had their homes destroyed for his own advancement.
Nitra is divided into two parts by the Nitricka (Nitra River), the Upper Town and the Lower Town. During the bishop’s heyday, the Upper Town was exclusively the residence of the burghers and other big shots of the town, while the other residents of Nitra lived in the Lower Town.
From the 15th to 17th centuries, Nitra was in the middle of many wars and occupations starting with the invasion by the Protestant Hussites in 1431. At the end of the 15th century, the Poles took Nitra, and in 1663, the Turks did. These invasions led to a reconstruction of Nitra, with the castle and its fortifications getting modernized for future warfare.
By the 18th century, Nitra was once again under Hungarian rule and was burnt to the ground in 1708. Most of Nitra's buildings that you see today are from the baroque and late baroque era of architecture.
Nitra became part of Czechoslovakia after 1918, and during World War II it was under German occupation. Nitra suffered significant damage during World War II by Allied air raids due to it being on the route to many of Romania's oil fields and central Slovakia's coal mines. After the war, Nitra was reconstructed, but many of its old buildings were not rebuilt because the Communists needed to build housing for the growing population of Nitra. What you see today is a combination of baroque and Communist architecture on the outskirts of town. Much of Nitra's Jewish population, like many of Slovakia's Jewish communities, perished at Auschwitz and other Nazi concentration camps, but Nitra's synagogue still stands today.
Today, Nitra's Upper Town is an Urban Conservation Area and the castle is a National Cultural Monument.