MADRID — Patxi Lopez, a former governor for the Basque region of Spain, says he will run in the Socialists’ leadership primary and hopes to lead the party to a national resurgence.

Lopez made his announcement Sunday in Madrid and is the first candidate to formally enter the race. The primary will be held in May to determine the Socialist leadership that was left vacant last fall, when Pedro Sanchez was forced out after losing consecutive presidential elections to Mariano Rajoy’s conservative party.

Spain has been in a state of political instability since two elections in a six-month span left Rajoy as prime minister but short of a majority and in need of alliances. The Socialists, one of the country’s major political groups, are also in disarray after two disappointing election defeats.