Catalonia is an autonomous community in Spain .
Barcelona ( , ) is the capital and largest city of Catalonia , an autonomous community in Spain , and the country 's second most populous municipality , with a population of 1.6 million within city limits .