* President seen swearing in govt on Friday
* Coalition deal ends three months of political deadlock
* 5-Star, League big-spending plans have spooked markets
* Little-known economist set to take over economy ministry (Recasts, adds Rome resident's comment)
ROME, May 31 (Reuters) - Italy's two anti-establishment parties revived their coalition plans on Thursday, promising to end three months of political turmoil with a government that aims to ramp up spending, challenge European Union fiscal rules and crack down on immigration.
The coalition deal, following inconclusive elections in March, removes the risk of a repeat vote, a prospect that had sparked a big selloff in Italian financial markets this week.
The leaders of the right-wing League and the 5-Star Movement patched up their alliance after agreeing to substitute a eurosceptic they had initially proposed as economy minister, a nomination that had been rejected by the head of state.
"All the conditions have been fulfilled for a political, 5-Star and League government," 5-Star chief Di Maio and far-right League leader Salvini said in a joint statement after several hours of talks in central Rome.
The deal followed an extraordinary few days in which Di Maio called for the head of state to be impeached, two successive prime ministers-designate were tasked to form a government, one of whom quit only to be reinstated on Thursday evening.
Giuseppe Conte, a little-known law professor close to 5-Star, will become prime minister, the leaders said.
Rome resident Vincenza Cariano summed up the exasperated mood on the street: "I can't stand it anymore. The country needs certainties, security and equilibrium."
The breakthrough came after the League and 5-Star agreed to drop economist Paolo Savona as their choice for economy minister. Savona, an 81-year-old economist, had said previously that Italy should have a contingency plan to abandon the euro.
He will be substituted by economics professor Giovanni Tria, another little-known figure, party sources said.
Global financial markets have been recovering over the past two days after tumbling on the spectre of repeat elections dominated by debate over Italy's future in the euro zone.
Italy, with debts totalling 130 percent of its economic output, is the most heavily indebted euro zone nation after Greece and is often described as "too big to fail".
Though investors were relieved to avoid repeat elections, which they feared could have become a de facto referendum on the euro, they are now likely to refocus on the big spending plans of the League and 5-Star, which would add to its debts.
The coalition has also said, in a joint policy manifesto signed during their first attempt at a union, that they will push the European Union to review the bloc's fiscal rules, which Salvini says have "enslaved" Italians.
The parties' new economics minister-designate, Tria, has been critical of the EU's economic governance, but unlike Savona he has not advocated a contingency plan for exiting the euro.
In recent articles, he has called for a change in the EU's fiscal rules to allow public investments to help growth and, like many mainstream economists, has criticised Germany's persistently large current account surplus.
"Maybe finally we have made it, after so many obstacles, attacks, threats and lies," Salvini said on Facebook shortly after the deal was announced.
After the first coalition attempt failed, President Sergio Mattarella named former International Monetary Fund official Carlo Cottarelli to form a stop-gap government of experts to lead the country to elections no sooner than September.
But Cottarelli failed to present a cabinet and received no support from any of the major parties. On Thursday, he formally gave up his mandate.
Assuming the new government gets a green light from Mattarella, Salvini will be the interior minister and Di Maio will take a powerful, newly-created joint ministry made up of the labour and industry portfolios, the parties said.
Salvini has promised as minister to ramp up deportations of irregular immigrants and to revamp the country's asylum system.
Enzo Moavero, a former EU affairs minister under the technocratic government of Mario Monti, will be foreign minister, while Savona, after his ousting as economy minister, gets the consolation prize of EU affairs minister. (Additional reporting by Eleanor Biles, Giselda Vagnoni, Philip Pullella, Giuseppe Fonte and Stefano Bernabei in Rome and Stephen Jewkes and Francesca Landini in Milan Editing by Mark Heinrich and Hugh Lawson)