MADRID — Pablo Iglesias and his Podemos party burst onto the Spanish political scene in 2015 by winning more than one-fifth of the vote in their first national election, igniting dreams of overtaking the Socialists as the largest left-wing party and reshaping the government.

Instead, after his meteoric rise, Mr. Iglesias faced internal party tensions and endured the same kind of criticism of his leadership and lifestyle that he had long thrown at a political establishment he called “the caste.” Support for his party has fallen sharply.

Yet Mr. Iglesias, 41, now looks likely to get his first chance to at least share power, under a deal that would see him take the post of deputy prime minister and his party become the junior partne r in a government headed by the more moderate Socialist leader, Prime Minister Pedro Sánchez.

With sharp rivalries and policy differences, it is an uneasy alliance, and the road ahead for Mr. Iglesias could be every bit as rocky as the last few years have been. But if Mr. Sánchez can win parliamentary approval for his proposed coalition, it would make Spain one of the few European countries — and easily the largest — where far-left ministers form part of government.