Portugal's president has rejected calls for an early general election following the resignation of the Prime Minister, Jose Manuel Durao Barroso.
Mr Lopes has replaced Mr Barroso as head of the ruling party
In a televised address, Jorge Sampaio announced that he was inviting the ruling Social Democrats to form a new government.
Mr Barroso is due to take over as President of the European Commission.
After Mr Sampaio's announcement, the leader of the opposition Socialist Party said he was resigning.
Eduardo Ferro Rodrigues, whose party won last month's European poll, had lobbied for an early election.
He had said that in view of that result, and with Mr Durao Barroso going off to Brussels halfway through his term, the centre-right Social Democrats had lost their legitimacy to govern.
Announcing his decision, President Sampaio said he had ended up choosing what was best for Portugal at a time when the country was still struggling to pull out of recession.
The Social Democrats and their right-wing coalition partners, the Popular Party, had insisted that continuity had to be maintained at all costs.
"It has been a complex decision, given the controversy which arose over the best way of dealing with the problem," Mr Sampaio said.
Provided the government retained its cohesion, "the resignation or permanent incapacitation of the prime minister is not sufficient reason, on its own, to
impose the need for an early general election", he added.
The president is expected to appoint Lisbon Mayor Pedro Santana Lopes, the new leader of the Social Democrats, as the new prime minister.
EU leaders picked Mr Durao Barroso as the next European Commission president at a special summit in Brussels last month.
His appointment as successor to Romano Prodi still has to be confirmed in a vote at the European Parliament later this month.