From the 12th to the 14th century, Sofia was a thriving centre of trade and crafts. It was renamed Sofia in 1376 after the Church of St Sophia. However, it was called both "Sofia" and "Sredets" until the 16th century, when the new name gradually replaced the old one.
