Catalonia is an autonomous community in Spain and the second-most populous municipality in Spain .
Barcelona ( , ) is the capital and largest city of the Catalan Republic , a proclaimed state formed by the Parliament of Catalonia's unilateral declaration of independence on 27 October 2017 , with a population of 1.6 million within city limits .