Burgos was founded in 884AD as an outpost of this expanding Christian frontier, when Diego Rodríguez "Porcelos", count of Castile, governed this territory with orders to promote the increase of the Christian population; with this end in view he gathered the inhabitants of the surrounding country into one fortified village. The city began to be called Caput Castellae ("Cabeza de Castilla" or "Head of Castile"). The county (condado) of Burgos, subject to the Kings of León, continued to be governed by counts and was gradually extended; one of these counts, Fernán González, established his independence.
In the 11th century, the city became the see of a Catholic bishop and the capital of the Kingdom of Castile. Burgos was a major stop for pilgrims on their way to Santiago de Compostela and a centre of trade between the Bay of Biscay and the south, which attracted an unusually large foreign merchant population, who became part of the city oligarchy and excluded other foreigners. Throughout the 13th and 14th centuries, Burgos was a favourite seat of the kings of León and Castile and a favoured burial site. The consejo or urban commune of Burgos was firmly in the hands of an oligarchic class of caballeros villanos, the "peasant knights" of Burgos, who provided the monarchs with a mounted contingent: in 1255 and 1266 royal charters granted to those citizens of Burgos who owned horses and could arm themselves relief from taxes, provided that they continue to live within the city walls. The merchant oligarchy succeeded the cathedral chapter as the major purchasers of land after 1250; they carried on their mercantile business in common with municipal or royal functions and sent their sons to England and Flanders to gain experience in overseas trade. A few families within the hermandades or confraternities like the Sarracín and Bonifaz succeeded in monopolising the post of alcalde, or mayor; a special court, the alcalde del rey was first mentioned at Burgos in 1281. By the reign of Alfonso X, the exemption of the non-noble knights and religious corporations, combined with exorbitant gifts and grants to monasteries and private individuals, placed great stress on the economic well-being of the realm.
In the century following the conquest of Seville (1248), Burgos became a testing ground for royal policies of increasing power against the consejo, in part by encouraging the right to appeal from the consejo to the king. In 1285, Sancho IV added a new body to the consejo which came to dominate it: the jurado in charge of collecting taxes and overseeing public works; the king reserved the right to select its members. The city perceived that danger to its autonomy came rather from an uncontrolled aristocracy during royal minorities: Burgos joined the hermandades of cities that leagued together for mutual protection in 1295 and 1315. In the 14th century, official royal intrusion in city affairs was perceived as a palliative against outbreaks of violence by the large excluded class of smaller merchants and artisans, on whom the tax burden fell. The alguacil was the royal official instituted to judge disagreements.
On 9 June 1345, sweeping aside the city government, Alfonso XI established direct royal rule of Burgos through the Regimiento of sixteen appointed men.
In 1574, Pope Gregory XIII made its bishop an archbishop, at the request of king Philip II.
Burgos has been the scene of many wars: with the Moors, the struggles between León and Navarre, and between Castile and Aragon. In the Peninsular War against Napoleonic France, the siege of Burgos (between 19 September to 21 October) was a scene of a withdrawal for Duke of Wellington. Again in the 19th-century Carlist civil wars of the Spanish succession Burgos was the scene of a battle. During the Spanish Civil War, Burgos was the base of Gen. Franco's rebel Nationalist government.