Fincantieri will buy 50 percent of the shipyard in the western French port of Saint Nazaire, the sources said, while the French state will "loan" another one percent stake for 12 years which can be retracted if it fails to keep promises made to the government.
French President Emmanuel Macron and Italian Prime Minister Paolo Gentiloni signed the agreement in the eastern French city of Lyon.
Later Macron hailed the deal as "a win-win agreement", pointing out that until recently STX was controlled by a South Korean group.
"Can someone explain to me, when we are defending Europe every day, how it would be better to have a Korean shareholder than an Italian operator!" Macron said.
France had said earlier it was ready to seek other buyers for its biggest shipyard should Italy refuse a 50-50 ownership split.
The Saint Nazaire shipyard employs some 2,600 people directly and another 5,000 subcontractors.
The French government sparked the row in July by temporarily nationalizing the shipyard after backsliding on a deal with Fincantieri agreed by then French president Francois Hollande in April.
After Economy Minister Bruno Le Maire announced the decision, saying it sought to protect France's "strategic interests", the Italian government expressed outrage, calling the move "inexplicable".
The shipyard has unique know-how that should not be lost to abroad, Le Maire argued.
But he insisted it was just a "temporary" move while France continued negotiations with Italy on shared ownership of the firm.
- How Italy's politicians greeted Macron's election win
- 'Stop stealing Mont Blanc', Italy tells France
- EU and African states agree on Italian plans to curb migration
Le Maire denied that the nationalization sent a protectionist message that contradicted Macron's campaign promise to defend free trade.
STX has built 120 cruise ships over its 150 years, and has another 11 lined up for the next decade.
Italy made much of the fact that South Korea's STX Shipbuilding - the outgoing owners - held a 66.6 percent stake, but Paris initially refused to let Rome hold a 51 percent stake.
The shipyards were nationalised as Fincantieri was eyeing a takeover.
Italy's frustration "is understandable, but the economic situation was completely different," Le Maire said. "The shipyard was in serious difficulty, now it is profitable and has 11 years of orders."
The centrist Macron had said he wanted to renegotiate the deal shortly after taking office in May.
Before Wednesday's summit in Lyon, the Italian daily La Stampa predicted a "complicated" accord aimed at allowing France to "save face after flexing its muscles."
The arrangement gives Italy operational control while France will enjoy the right of a veto over the choice of the company's director and various strategic decisions such as hiring.
Italian press reports say the tie-up will be enlarged to include Naval Group, France's military shipbuilder.
By Marie-Morgane Le Moel