Guinea-Bissau President Jose Mario Vaz on Saturday appointed Aristide Gomes as prime minister, ending a political deadlock that dragged on since legislative elections in May.
"Mr Aristide Gomes is named prime minister," a presidential decree said, adding that Gomes would be appointed on Saturday.
Vaz had so far refused to name his estranged deputy Domingos Simoes Pereira prime minister in the tiny West African country.
The ruling African Party for the Independence of Guinea Bissau and Cape Verde (PAIGC) party then proposed Gomes as its candidate for premier.
The Economic Community of West African States on Thursday gave Guinea Bissau a weekend deadline to name a prime minister or face sanctions.
It had been hoped that the March 10 vote would draw a line under a crisis that erupted in August 2015 when Vaz sacked Pereira, his then prime minister.
The vote saw the PAIGC and its allies control 54 of parliament's 102 seats but lawmakers proposed Pereira, the party leader, as prime minister, a move rejected by Vaz.
Vaz's five-year rule as president ends on Sunday.
Sitting between Senegal and Guinea on Africa's west coast, Guinea-Bissau has struggled with volatility for years. It has seen multiple coup attempts since independence from Portugal in 1973.