<p>The Spanish prime minister had repeatedly insisted he would serve out his four-year term, with elections scheduled for 2027.</p>