MADRID — Prime Minister Mariano Rajoy is the great survivor of Spanish politics. He has withstood electoral defeats, a banking bailout and party corruption scandals, not by demonstrating political boldness but rather by being cautious and often waiting for others to fail.

Now, however, Mr. Rajoy’s political survival is at stake — as well as the unity of Spain — as a secessionist challenge that he allowed to fester in Catalonia threatens to spiral out of control. His support for the recent arrests of Catalan separatists and elected officials has emboldened the independence movement. It was a rare forceful move by Mr. Rajoy — and it could backfire.

“Rajoy has always shown the phlegmatic approach of a clever administrator rather than the vision of a great political leader,” said Josep Ramoneda, a political columnist and philosopher. “But I think he is now going to pay a high price for his inactivity and unwillingness to take charge of this issue and for believing instead that Catalonia was a problem that would somehow die on its own.”

Catalonia’s separatist regional government is preparing to hold an independence referendum on Oct. 1, ignoring opposition from politicians and judges in Madrid who say the vote would violate the Constitution. On Wednesday, the Spanish police raided the regional government’s headquarters in Barcelona, arresting 14 people.