MADRID — Spanish police arrested 12 people Wednesday in raids on offices of the regional government of Catalonia, news reports said, intensifying a crackdown on the region’s preparations for a secession vote that Spain says is illegal.

It was the first time Spanish authorities have detained Catalan officials since the campaign for a secession vote in Catalonia began to gather momentum in 2011.

Spain’s Europa Press news agency and other media outlets said the raids mostly targeted Catalonia’s economic and foreign departments as authorities worked to halt all preparatory moves for the referendum planned for Oct. 1.

Hundreds of people immediately began gathering to protest the raids and shout pro-independence slogans outside government offices in the region’s capital, Barcelona.

The Catalan regional government confirmed Josep Maria Jove, secretary general of economic affairs, was among those arrested. Jove is number 2 to the region’s vice president and economy chief, Oriol Junqueras.

Police and judicial authorities declined to give details on the operation because a judge has placed a secrecy order on it.

An Interior Ministry statement said only that Civil Guard police were carrying out an operation to gather evidence as part of investigations into the referendum’s preparations.

Spanish Prime Minister Mariano Rajoy’s conservative government is waging myriad legal battles to halt the referendum called by the pro-independence coalition ruling Catalonia.

Backed by most Spanish opposition parties, the government says the referendum violates the constitution and that if Catalonia wants a vote it must work to change the constitution first.

The Constitutional Court has ordered the vote to be suspended as it studies its legality, but Catalan officials say they will press ahead regardless.

Catalonia represents a fifth of Spain’s 1.1-trillion-euro economy.

The region’s 7.5 million inhabitants overwhelmingly favor a referendum but are roughly evenly divided over independence.