MADRID (Reuters) - Spanish lawmakers on Wednesday voted down a no-confidence motion in Prime Minister Mariano Rajoy brought by the anti-austerity Podemos party.

The motion had not been expected to garner the majority of votes needed to oust Rajoy given the Socialists had said they would abstain and the liberal Ciudadanos and other smaller regional parties had said they would vote against the proposal.

But the move from Podemos was primarily aimed at portraying the party as leader of the opposition to the center-right government at a time when the Socialists have just picked a new leader and are struggling with falling support, analysts say.

“We are on the right track to build up an alternative majority,” Podemos leader Pablo Iglesias said after the vote.

“Today, we are one step closer to removing the People’s Party from the institutions.”

The motion was rejected with 170 votes against, 82 votes for and 97 abstentions, roughly in line with the breakdown when Rajoy was voted in as prime minister last year, showing there has been no change in the balance of power in parliament.

Rajoy, who has secured support for the budget and obtained as a result at least two years of stability, said he was satisfied with the outcome of the vote.

“It has been rejected by a wide majority and this means we will be able to keep working,” he told journalists.