BARCELONA, Spain — These days, the city of Barcelona wears two hats. And not too comfortably.

On the one hand, Barcelona is a global city, a former host of the Olympics, and the home of one of the world’s most famous soccer clubs, F.C. Barcelona. It is a magnet for more than 10 million visitors a year, an example of the ways large cities increasingly influence global politics, economics and culture.

On the other hand, Barcelona is the capital of Catalonia, Spain’s restive northeastern region, and the nerve center of a drive for Catalan independence that is described by its opponents as parochial, exclusive and nationalist.

In that campaign — which the Spanish government now says it will take emergency measures to halt — there is no place in Catalonia with more at stake. In Barcelona, the issue of independence has provoked exceptionally sharp soul-searching and debate over allegiances and identity, with an intensity not seen since Britain voted to leave the European Union.

In short, people are worried. First among them is the city’s leftist mayor, Ada Colau, who, despite expressing support for independence in the past, says she is now not in favor of leaving. “It’s a very pluralistic city and there is a lot of diversity of opinions in Barcelona,” she said in an interview this week.