MADRID — The Spanish government teetered on the brink of collapse Wednesday, as the dispute over the status of the prosperous northeastern region of Catalonia stymied passage of a national budget and threatened to usher in another round of protracted political uncertainty.

Prime Minister Pedro Sánchez, one of the few Socialist leaders left standing on the European political stage, was hoping to use his budget to increase social spending and address the inequalities that have accompanied Spain’s economic recovery.

Instead, Mr. Sánchez, who leads a precarious minority government, was now facing a decision in coming days on when to call new elections — a seeming inevitability — after Catalan lawmakers withdrew their support, trying to force the issue of independence for their region back to the fore of Spanish politics.

For Spain, and indeed all of Europe, a new round of political turbulence could hardly come at a worse time. The Continent already faces the challenge of Brexit, as the British divorce from the European Union is called, with a deadline of March 29 looming.