The most ancient archaeological evidences attested in Osimo's territory come from the lower valley of the Musone and of its right tributary Fiumicello: there are a lot of flint chipped objects, found with animal bones and hartshorns, ascribable to the Upper Paleolithic (40000 - 12000 years ago). In the IX century b.C the Picenes settled down on the hills of Osimo and on Mount St. Peter and established two different colonies with two different necropolis.
With the battle of "Sentinum" (which nowadays is Sassoferrato) in 295 B.C the Romans started to conquer the Piceno, involving also Osimo (Auximum): the historian Livio narrates that in 174 B.C the censors Q. Fulvius Flaccus e A. Postumius Albinus farmed out the city walls and decided to build tabernae (workshops) around the forum. Considering the impregnability of the town and its central position compared with the Picenes' area the Romans also decided to lay a colony in 157 B.C, whose citizens were registered in the Velina tribe.
In the early Medieval period the town continued to play a key role in this area. This strategical role is emphasized by important events of the Greek-Gothic war (535-553), which is part of the military campaign that the eastern emperor, Giustiniano, started to reconquer the western Mediterranean sea. In 727-728 A.D the town was conquered by the Lombards leaded by king Liutprando: he made Osimo and Ancona dukedoms and crucial points for controlling the expansionist aims of the Spoleto Duke.
In 774 the Lombard king Desiderio threaten Pope Adriano I, who asks Carlo Magno (king of the Franks) for help; he succeed in defeating the enemy and he annexes the Lombards' territory to the Frankish kingdom; moreover, loyal to his father's promise, he donate the exarchate and the pentapolis (in which Osimo is included) to the pope, all territories that will form the core of the nascent Papal states.
At the beginning of the XII century the town was one of the first to become free medieval commune, gaining great importance in the area: during the fights between Guelphs and Ghibellines Osimo stayed with the second faction, and because of this it lost the bishop's throne twice: once in the middle of 1200 and the second time in the first half of XIV century, after the revolt of the brothers Lippaccio and Andrea Gozzolini; in this occasion the town lost also the title of "commune". This really weaken Osimo that went through a long period of instability under foreigners domains: the Malatesta from Rimini (1399-1430), that was directly sent by the Pope and Francesco Sforza (1433-1443) sent by Filippo Maria Visconti, duke of Milan, to weaken the papal power.
At the beginning of 1500 the town came back to the Papal states, enjoying a long period of peace and prosperity that left lots of traces, as for example the beautiful buildings that we can find in the city centre. It was also a cultural centre thanks to the establishment of Campana College, that recalled famous teachers and students, then become famous as the Popes Leone XII and Pio VIII. Throughout the Napoleonic occupation, Osimo was submitted by France and became part of the Musone Department: then the pontifical government was brought back but it was a short life because soon lots of citizens, leaded by the count Francesco Fiorenzi took up arms and fought for the Italian independence in the famous battle of Castelfidardo (18 september 1860). After the bombardments of Ancona in October 1943 Osimo took the role of regional capital as all the government offices moved here until its capitulation. Osimo was set free by the partisans of the fifth division Garibaldi Marche on the 6th of July 1944 but the harsh battle of the Musone lasted until the 18th of july. In the opinion of the polish general Anders the battle that was fought between Osimo and Filottrano, was the most sanguinary for the polish army after that of Montecassino. The demolition of the german defensive line "Edith", along the river Musone, allowed the occupation of Ancona's port, that speeded the assault to the Gothic line.