A coalition government has been agreed in Italy, ending months of uncertainty in the EU's fourth-biggest economy.
Prime Minister-designate Giuseppe Conte presented his list of ministers to President Sergio Mattarella for the second time in a week and the new government will be sworn in on Friday.
Ministers are drawn from both the anti-establishment Five Star (M5S) and the right-wing League.
Attempts to form a technocratic government had failed.
Mr Mattarella rejected Mr Conte's original choice for economy minister but a different candidate was agreed on Thursday.
Conflict with EU not over
Analysis by BBC's James Reynolds in Rome
Four days of political and constitutional crisis are over. And a new populist government - led by law professor Giuseppe Conte - will now be sworn in.
In the end, the populist parties decided to back down and accept the president's veto of their original choice of a eurosceptic economy minister.
Their newly chosen minister, Giovanni Tria, is in favour of Italy's continued membership of the single currency.
But the populists' conflict with the EU is not entirely over. The M5S and the League have promised both new welfare spending and also tax cuts - which may run into conflict with the EU's spending rules.
League leader Matteo Salvini will be the interior minister. He has promised a tough new policy on migration, which may provoke arguments within Europe.
What deal was reached?
After meeting President Mattarella, Mr Conte confirmed reports that the new candidate for the key economy minister post would be economics professor Giovanni Tria.
M5S leader Luigi Di Maio and Mr Salvini said in a brief joint statement: "All the conditions have been met for a M5S-League government."
Other notable appointments to the new cabinet include:
- Interior and Deputy Prime Minister: Matteo Salvini (League)
- Industry and Deputy Prime Minister: Luigi Di Maio (M5S)
- Foreign: Enzo Moavero Milanesi (independent, ex-European Affairs minister)
- Defence: Elisabetta Trenta (M5S)
- European affairs: Paolo Savona (independent), the controversial original choice for finance
"We will work intensely to realise our political objectives which we have already put together in our government contract," Mr Conte was quoted as saying by the Reuters news agency.
The new government is expected to be sworn in later on Friday.
After the ceremony, it will face confidence votes in both chambers of parliament, where the M5S and the League have a majority.
Italy is no stranger to political turmoil - it has had 64 governments since World War Two.
Mr Conte is taking over from Paolo Gentiloni, who led a coalition cabinet for two years.
How did we get here?
4 March: 5-Star wins 32% of the vote in the general election, with the League taking 18%.
The two populist parties eventually attempt to form a coalition, putting forward Mr Conte, a political novice, as prime minister.
28 May: Mr Conte presents his cabinet list to President Mattarella who vetoes the choice of Mr Savona as finance minister on the grounds that he is a eurosceptic. Mr Conte bows out. Both parties are furious and Mr Di Maio calls on parliament to impeach Mr Mattarella. The president asks ex-IMF economist Carlo Cottarelli to form a technocratic government until fresh elections can be held.
30 May: Mr Cottarelli appears to suspend his own efforts to form an interim administration as Five Star and the League engage in new talks.
31 May: Mr Conte returns to the president with a new cabinet list, which is accepted.