The Ottoman conquest of Bosnia and Herzegovina was a process that started roughly in 1386, when the first Ottoman attacks on the Kingdom of Bosnia took place. In 1451, more than 65 years after its initial attacks, the Ottoman Empire officially established the Bosansko Krajià ¡te (Bosnian Frontier), an interim borderland military administrative unit, an Ottoman frontier, in parts of Bosnia and Herzegovina. In 1463, the Kingdom fell to the Ottomans, and this territory came under its firm control. Herzegovina gradually fell to the Ottomans by 1482. It took another century for the western parts of today's Bosnia to succumb to Ottoman attacks, ending with the capture of Bihaàin 1592.
The entire territory that is today known as Bosnia and Herzegovina took the Ottoman Empire several decades to conquer.
Military units of the Ottoman Empire made many raids into feudal principalities in the western Balkans at the end of the 14th century, some of them into territory of today's Bosnia and Herzegovina, long before the conquest of the Bosnian Kingdom. The first Ottoman raids led by Timurtash-Pasha happened in the eastern parts of Bosnia in 1384. The Battle of BileÃÂa in 1388 was the first battle of the Ottoman army on the territory of today's Bosnia and Herzegovina. It soon won important victories against the regional feudal lords in the Battle of Marica (1371) and Battle of Kosovo (1389).
In 1392 the Ottomans established the Skopsko Krajià ¡te after the capture of Skopje, the capital of the Serbian Empire between 1346-1371; the term ' () had originally served as an administrative unit of the Serbian Empire or Despotate to designate border regions where the emperor or despot had not established solid and firm control due to raids from hostile neighboring provinces. The militarized territories that later named Bosansko Krajià ¡te (lit. Bosnian Frontierland) were governed by the same Ottoman administration, based in Skopje.
After the death of King Tvrtko I in 1391, the Bosnian Kingdom went into decline. In the 1410s, local noblemen Hrvoje VukÃÂiàof the House of HrvatiniÃÂ, Sandalj Hraniàof the House of KosaÃÂa and Pavle Radenoviàof the House of Pavloviàcontrolled large swaths of territory once controlled by Tvrtko, and effectively controlled the Kingdom by aligning themselves with competing branches of the House of KotromaniÃÂ. In 1413, a conflict escalated between Hrvoje and Sandalj while the latter was helping Stefan Lazareviàfight the Ottomans in Serbia; subsequently, Hrvoje allied himself with the Ottomans, who invaded Bosnia in May 1414, which prompted a subsequent invasion by the troops of the Kingdom of Hungary. In a major battle in August 1415 that took place either near Doboj or in the Laà ¡va Valley, the Ottomans won a major victory, upsetting the balance of power in the region.
The first permanent presence of Ottoman armies in Bosnia was established in 1414, after the region near Donji Vakuf (known as Bosnian Skoplje in medieval times) was captured. In period between 1414 and 1418, the Ottoman Empire conquered FoÃÂa, Pljevlja, ÃÂajniÃÂe and Nevesinje. During the same year Vià ¡egrad and Sokol were captured too.
In 1415, Sandalj HraniÃÂ, who controlled today's eastern Herzegovina, became an Ottoman vassal.
Isa-Beg IsakoviÃÂ organized in 1455 one of the first Ottoman censuses in the western Balkans.
By the end of this period, in the 1460s, the territory of the Kingdom of Bosnia was significantly reduced, with the Ottoman Empire controlling the entirety of today's eastern Bosnia, as far north as à  amac, and Herceg Stjepan under control of all of today's Herzegovina as far north as GlamoÃÂ.
The Ottoman conquest of the Kingdom of Bosnia ended in 1463 with the death of King Stjepan Tomaà ¡eviÃÂ. The Siege of Jajce ensued shortly thereafter in which the Kingdom of Hungary retook the Jajce Fortress. The victory was hailed at Matthias Corvinus's court as a restoration of the Kingdom of Bosnia, then under Hungarian sovereignty. The Hungarians formed the Banate of Jajce after that.
Isa-beg became the first sanjakbey of the Bosnian Sanjak in 1464.
After taking the Kingdom of Bosnia in 1463, Mahmud Pasha also invaded Herzegovina and besieged Blagaj after which Herceg Stjepan conceded a truce that required ceding all of his lands north of Blagaj to the Ottomans.
The Ottoman territory in Bosnia continued to be expanded into newly-established sanjaks: the Sanjak of Herzegovina was formed in the 1470, subordinated to the beglerbey of Rumelia like the Bosnian sanjak. In 1480, the Sanjak of Zvornik was formed but subordinated to the Beglerbey of Budim.
Even though the Bosnian Kingdom fell, there were several fortresses that resisted much longer – the last fortress in Herzegovina fell in 1481. The House of KosaÃÂa maintained the Duchy of Saint Sava as an Ottoman vassal state until 1482.
In 1481, after the death of Mehmed II, Matthias Corvinus invaded Bosnia again and reached Vrhbosna (Sarajevo), but all of those gains were undone within a year.
In the 1530s, the Kingdom of Hungary had remained in control of the forts on the south bank of the Sava and Jajce. Jajce Fortress was finally taken by the Ottomans in 1527.
The House of BerislaviÃÂ controlled the region of Usora in the north until it in turn succumbed in the 1530s.
Parts of southwestern Bosnia were sectioned into the Sanjak of Klis, which was formed in 1537 subordinated to the Eyalet of Rumelia.
The Eyalet of Bosnia was established in 1580.
In 1592 with the fall of BihaÃÂ it reached the westernmost frontiers of what is modern Bosnia, and the modern western border of Bosnia was established. After that the territory of today's Bosnia and Herzegovina remained largely undisturbed under Ottoman rule until 1689 and the Great Turkish War.