Complex sentence: When the city was founded it had fought a lot of enemies through the centuries: first the Slavic tribals who lived there until the city was founded, then the Swedes in the Thirty Years' War (1618-1648).
Split into simpler sentences: When the city was founded it had faught a lot of enemies through the centuries. Then the Swedes in the Thirty Years' War (1618-1648).