Portugal's president named Socialist leader Antonio Costa as prime minister on Tuesday, ending weeks of political stalemate and paving the way for the first Socialist government backed in parliament by the far left.

The Socialists have promised to end years of harsh austerity, increase families' disposable incomes and help the poor, who suffered during Portugal's debt crisis and the bailout that ended last year.

Together with the far left Communists and Left Bloc, Costa two weeks ago toppled the minority center-right coalition that had returned to power after winning most votes in an election on Oct. 4 but losing its overall majority.

The political turmoil of recent weeks has prompted fears that an economic recovery could be undermined, and has been seen by some analysts as the most critical moment in Portuguese politics since the 1974 Carnation Revolution, when a right-wing dictatorship was overthrown and democracy ushered in.

President Anibal Cavaco Silva had requested written assurances from Costa that he and his leftist partners would respect Portugal's commitments to EU budget rules, something that Costa - but not his partners - had pledged to do.

He also requested that the two far-left parties whose support the Socialists must rely on in parliament, the Left Bloc and the Communists, pledge not to propose motions of no confidence to try to bring the government down.

"After hearing political parties with parliamentary representation, the president has decided to nominate Antonio Costa for prime minister," the president said in a statement.

The Socialist Party's leader, Carlos Cesar, said he expected the government to be sworn in this week.

Costa's Socialists responded to the president's demands, saying in a statement that they were "duly noted ... in terms of the stability and durability of a minority Socialist government through the legislature's term".

The president added that leaving the center-right government of Pedro Passos Coelho in office in a caretaker status "does not correspond to the national interest".