The history of Sofia, Bulgaria's capital and largest city, spans thousands of years from Antiquity to modern times, during which the city has been a commercial, industrial, cultural and economic centre in its region and the Balkans.

Sofia was originally a Thracian settlement called Serdica or Sardica (Greek: Σερδική, Σαρδική), named after the Celtic[1] tribe Serdi that had populated it.For a short period during the 4th century BC, the city was possessed by Philip of Macedon and his son Alexander the Great.

Around BC 29, Sofia was conquered by the Romans and renamed Ulpia Serdica. It became a municipium, or centre of an administrative region, during the reign of Emperor Trajan (98-117). The city expanded, as turrets, protective walls, public baths, administrative and cult buildings, a civic basilica and a large amphitheatre called Bouleutherion, were built. When Emperor Diocletian divided the province of Dacia into Dacia Ripensis (on the banks of the Danube) and Dacia Mediterranea, Serdica became the capital of Dacia Mediterranea. The city subsequently expanded for a century and a half, which caused Constantine the Great to call it "my Rome". In 343 A.D. , the Council of Sardica was held in the city, in a church located where the current 6th century Church of Saint Sofia was later built.

Serdica was of moderate size, but magnificent as an urban concept of planning and architecture, with abundant amusements and an active social life. It flourished during the reign of Byzantine Emperor Justinian I, when it was surrounded with great fortress walls whose remnants can still be seen today.

The city was destroyed by the Huns in 447 but was rebuilt by Byzantine Emperor Justinian and renamed Triaditsa. Although also often destroyed by the Slavs, the town remained under Byzantine dominion until 809.