In this photo dated May 29, 2023 Spanish Prime Minister Pedro Sanchez speaks at La Moncloa Palace in Madrid. (PHOTO / AFP)

MADRID — Spanish Prime Minister Pedro Sanchez on Monday called a general election for the country on July 23.

Sanchez announced his decision from his official residence following the defeat of his Spanish Socialist Party (PSOE) to the People's Party (PP) in the elections for 12 of Spain's regional governments and over 8,000 city halls on Sunday.

PP has also won the city hall in Valencia, Zaragoza and in Seville, which has long been considered a socialist stronghold

Sanchez said in a brief statement: "I have communicated to the Head of State (King Felipe VI) the decision to call a Council of Ministers this afternoon to dissolve Parliament and proceed to call a general election."

READ MORESpain's conservative PP elbows Socialists out in regional polls

The prime minister explained that he had taken his decision in "the face of yesterday's (Sunday's) results," adding he believed it was the "best for the Spanish people to be able to give their decision and define the political future of this country without delay."

In the regional and municipal votes on Sunday, PP had won 31.5 percent of the vote, whereas PSOE gained 28.11 percent. Meanwhile, the Vox party saw its votes almost doubled compared to the 2019 local elections.

PP has also won the city hall in Valencia, Zaragoza and in Seville, which has long been considered a socialist stronghold.

READ MORE: 50 years of ties with Spain seen as new starting point

On Sunday night, the PP leader, Alberto Nunez Feijoo, celebrated his party's victory in the regional and municipal votes, calling it a "the start of a new political era."