Sarajevo is a city in Bosnia and Herzegovina.

Ancient history The earliest known settlements in Sarajevo were those of the Neolithic Butmir culture. The discoveries at Butmir were made in modern-day Ilidža, Sarajevo's chief suburb. The area's richness in flint, as well as the Željeznica river helped the settlement flourish. The Butmir culture is most famous for its ceramics."Butmir Culture Pot"

The Butmir culture was conquered by the Illyrians around 2400 BC. The most prominent of their settlements near Sarajevo was Debelo Brdo (literally "Fat Hill"), where an Illyrian fortification stood during the late Iron Age. Numerous Illyrian forts also existed in other parts of the city, as well as at the base of Trebević. The Illyrians in the Sarajevo region were the Daesitiates, who were the last to resist Roman occupation. Their last revolt occurred in 9 AD, and was stopped by the emperor Tiberius, marking the start of Roman rule in the region.

Under Roman rule, Sarajevo was part of the province of Dalmatia. A major Roman road ran through the Miljacka river valley, connecting the cities of the Adriatic coast with Pannonia in the north. The largest known settlement in the region was known as "Aquae S..." (probably Aquae Sulphurae), at present-day Ilidža.

Middle Ages

The Slavs came to Bosnia in the 7th century. It is fairly certain that they settled in the Sarajevo valley, replacing the Illyrians. Katera, one of the two Bosnian towns mentioned as a part of Serbia by Constantine Porphyrogenitus in De Administrando Imperio, was southeast of Sarajevo. By the time of the Ottoman occupation in the 15th century, there was little settlement in the region.

The first mentions of Bosnia describe a small region, basically the Bosna river valley, stretching from modern-day Zenica to Sarajevo. In the 12th century, when Bosnia became a vassal of Hungary, the population consisted primarily of members of the Bosnian Church. The area of present-day Sarajevo was part of the Bosnian province of Vrhbosna. Another theory is that Vrhbosna was a major settlement located in the middle of modern-day Sarajevo. Perhaps a village existed on the outskirts of the city itself, near present-day Ilidža, one of the most attractive regions in the area, which had been significantly populated for about every other period of its history. It is possible that Vrhbosna may have been destroyed sometime between the 13th century and the Ottoman occupation. Foreign armies had often made their way to Vrhbosna in wars with Bosnia, and perhaps one of them razed the city, leaving it in the condition that the Turks found it in the mid-15th century. Papal documents indicate that in 1238, a cathedral dedicated to Saint Paul was built in the city. It is speculated that the cathedral was located in the present-day Sarajevo neighborhood of Skenderija, as during construction in that neighborhood in the late 19th century, Roman-style columns were found dating to some time around the 12th century. Disciples of the saints Cyril and Methodius traveled to the region, founding a church near Vrelo Bosne. Vrhbosna was a Slavic citadel from 1263 until it was occupied by the Ottoman Empire in 1429."Sarajevo", Columbia Encyclopedia, edition 6, Retrieved on 3 August 2006

Various documents from the High Middle Ages reference a place called 'Tornik' in the region. By all indications, 'Tornik' was a very small marketplace and village, and was not considered important by Ragusan merchants. The local fortress of Hodidjed was defended by a mere two dozen men when it fell to the Turks. Sarajevo also fell under siege.

Early Ottoman era Sarajevo was founded when the Ottoman Empire conquered the region, with 1461 typically regarded as the date of the city's founding. The first known Ottoman governor of Bosnia, Isa-Beg Ishaković, chose the village of Brodac as a good space for a new city. He exchanged land with its residents, giving them what is now the Hrasnica neighborhood in Ilidža. He built a number of buildings, including a mosque, a closed marketplace, a public bath, a bridge, a hostel, and the saray which gave the city its present name. The mosque was named "Careva džamija" (the Emperor's Mosque, or the Imperial Mosque) in honor of Mehmed II. Sarajevo quickly grew into the largest city in the region. Many Christians converted to Islam at this time, and there was a growing Orthodox population. A colony of Ragusan merchants also appeared in Sarajevo at this time. In the early 16th century, Jewish refugees from Andalusia brought the Sarajevo Haggadah.

Under the leadership of Gazi Husrev-beg, a major donor who was responsible for most of what is now the Old Town, Sarajevo grew at a rapid rate. Sarajevo became known for its large marketplace and its mosques, of which there were more than one hundred by the middle of the 16th century. Gazi Husrev-Beg established a number of buildings named in his honor, such as the Sarajevo library. He also built the city's clock tower, the Sahat Kula.

At its height, Sarajevo was the largest and most important Ottoman city in the Balkans after Istanbul. By 1660, the population of Sarajevo was estimated to be over 80,000.

Late Ottoman era

Following the Battle of Vienna in 1683, the western portion of the Ottoman Empire was subject to raids. Prince Eugene of Savoy raided Sarajevo and torched it.

An important chronicler of the time was Mula Mustafa Bašeskija who wrote about Sarajevo. Significant libraries, schools, mosques, and fortifications were built during the late Ottoman era. Mustafa wrote about the tensions between the dervish and Kadizadeli, the latter being a significant influence on the city.

In 1762, a plague epidemic hit the city, taking about 15,000 lives. At the time, city's population numbered some 20,000. In 1783, there was another outbreak; some 8,000 people died. Fires and floods were also common. The overflowing Miljacka threatened the city's bazaar. A major flood occurred in 1783 and another in 1791. The largest fire occurred in 1788.

By the early 19th century, Serbia gained independence from the Ottoman Empire, creating a wedge between Sarajevo and Istanbul.

Demanding Bosnian independence from the Turks, Husein-Kapetan Gradaščević fought several battles around Bosnia. The last was the Battle of Sarajevo Field in 1832, where he was betrayed by a fellow Bosniak and lost. There, he spoke his famous words, "This is the last day of our freedom." For the next several decades, no major developments occurred.

Austria-Hungary

Background The Berlin Treaty was imposed by the Great Powers upon the rapidly dissolving Ottoman Empire, which entered the negotiations from a position of weakness, with many of its former territories having achieved de facto independence over the previous half-century and having just been defeated in the Russo-Turkish War. Although the Bosnia Vilayet was part of the Ottoman Empire de jure, it was de facto governed as an integral part of Austria-Hungary with the Ottomans having no say in its governance.

Eastern Crisis 1875–1878 Previously, the Ottoman position in the Bosnia Vilayet was weakened by the 1875–1877 Herzegovina uprising, an armed revolt by the local ethnic Serb population that began in the Herzegovina region in July 1875 before spreading to the rest of the vilayet. The uprising lasted more than two years before the Ottomans, aided by the local Muslim population, managed to stop it. In 1875, inspired by the Herzegovina uprising, the exiled Bulgarian revolutionaries operating out of the neighbouring United Romanian Principalities (another de jure Ottoman vassal which was steadily moving towards independence) began planning for their own uprising which began in the spring of 1876. The Ottoman reaction to the Bulgarian insurrection was swift and brutal, leading to many atrocities and universal international condemnation as the uprising was put down within months.

Austria-Hungary closely followed the events of the 1875 Serb peasant rebellion in Bosnia. Shaped by the Austrian-Hungarian foreign minister, Count Gyula Andrássy, who was appointed in 1871 to replace Friedrich von Beust, the dual monarchy's foreign policy identified the Near East as the area of particular interest for its next expansion. Andrássy saw an opportunity to move this policy forward, and on 30 December 1875 he sent a dispatch to his foreign ministry predecessor, Von Beust, who was the Austro-Hungarian Foreign Service's ambassador to the United Kingdom. In the document, known as the "Andrássy Note," Andrássy outlined his vision for Bosnia as a territory governed and administered by Austria-Hungary. After obtaining general assent from the UK and France, the document became official basis for negotiations.

Simultaneous with their defeats in the Russo-Turkish War, Ottoman rule in the Bosnia Vilayet was weakening. Logistical and organisational issues began arising in the Ottoman army, such as inability to feed and clothe its soldiers, including the nineteen garrisons stationed in the Bosnia Vilayet, seventeen of which were made up of local Bosnian Muslims. In a January 1878 report, the Austro-Hungarian consul stationed in the city of Sarajevo, Konrad von Wassitsch, noted to his Vienna superiors that "Ottoman administrative bodies have no authority, and the population has lost its confidence in the government." By spring of 1878, the Ottoman Army in the vilayet was in such a state of disarray that many troops deserted after being left to their own means. As a consequence, an estimated three thousand armed deserters were roaming the countryside in small bands, frequently terrorizing peasants. With no organized force implementing the law, groups of outlaws operated with impunity in many rural areas, effectively seizing control of significant territories.

Treaty of San Stefano

By late winter of 1878, it became clear that Ottoman authority in the area was weakened. The Treaty of San Stefano, imposed on 3 March 1878 by Russia upon the defeated Ottomans, confirmed it. Among other provisions, it stipulated that there would be full independence from the Ottoman Empire for the principalities of Serbia and Montenegro, de jure autonomy (de facto independence) within the Ottoman Empire for the Principality of Bulgaria, and autonomous province status for the Bosnian Vilayet within the Ottoman Empire.

The Muslim population of the Bosnia Vilayet welcomed the promised greater autonomy thus rekindling their autonomy aspirations. However, international reaction to the treaty was mostly negative. The Great Powers, especially British Prime Minister Benjamin Disraeli, were unhappy with the extension of Russian power, while Austria-Hungary was also disappointed as the treaty failed to expand its influence in the Bosnia Vilayet. In a 21 April 1878 memorandum to the European powers, the Austro-Hungarian foreign minister Gyula Andrássy proposed his Bosnia policy, making a case for a Habsburg occupation of Bosnia Vilayet. He argued that an autonomous Bosnia within the Ottoman Empire lacked the means to overcome internal divisions and maintain its existence against its neighbours.Taming Balkan Nationalism: The Habsburg ‘Civilizing Mission’ in Bosnia 1878–1914;Robert Okey, 2007 The United Kingdom supported Austria-Hungary's aspirations in Bosnia.

Many of the smaller nations also had objections to the San Stefano Treaty—although satisfied with receiving formal independence, Serbia was unhappy with the Bulgarian expansion, Romania was extremely disappointed as its public perceived some of the treaty stipulations as Russia breaking the Russo-Romanian pre-war agreements that guaranteed the country's territorial integrity, and the Albanians objected to what they considered a significant loss of their territory to Serbia, Bulgaria and Montenegro. Besides Bosnian Muslims, Bulgaria was the only nation happy with the treaty.

Local reaction to the prospect of Austro-Hungarian occupation