Bogota's origins can be traced back to 1538 when a certain Gonzalo Jimenez de Quesada thought that it was a good location to found a settlement for his fellow Spaniards; it was actually built on the site of Teusaquillo, a small indigenous settlement in the area predominantly inhabited by Chibcha speaking people. It was originally called Santa Fe.
The town steadily grew and soon became the capital of the New Kingdom of Granada (the Royal Court was established there in 1550). By the beginning of the 19th century, its population had reached 30,000 and its cultural, academic and artistic offerings showed all the characteristics of a true national capital, with three universities, a large number of monasteries, convents and schools, as well as numerous collections of paintings, carvings and sculptures.
A new chapter in the town's life began on 20 July 1810 when the independence movement started; a charismatic Simon Bolivar (still very much in the minds and hearts of the today's Latin America) was elected president of the new republic which desperately tried to run away from the despotic, greedy and parasitic rule of the Spanish court. In 1819 the town changed its name to Bogota.
The town has since then developed its infrastructure, and established itself as the country's main urban centre. The 20th century remained interestingly fairly dictators' free period (which cannot be said of the rest of that often troubled continent).
Bogota earned a bad reputation, however, through its notoriously poor safety record, mainly to do with the narco-mafia and organised crime that plagued the city in the 1980s and early 1990s. The situation, though, improved substantially in the 2000s after the former NYC mayor Rudolph Giuliani's crime fighting policies were implemented by Colombia's current president Alvaro Uribe.