Italy have been without a permanent coach since Gian Piero Ventura was sacked after the four-time world champions failed to qualify for the World Cup for the first time since 1958.
The Italian football federation had been looking for a prestigious coach to rebuild an Azzurri side decimated after their play-off defeat by Sweden at the San Siro last November.
The names of former Bayern Munich coach Carlo Ancelotti and Chelsea boss Antonio Conte had also been touted, with Ancelotti reported to have said "no".
Mancini had shown an early interest in taking over the national side and was ready to sever his lucrative contract with Zenit St Petersburg.
After his three-year contract was officially terminated by mutual consent on Sunday, the 53-year-old flew immediately to Rome on Monday morning and signed his new deal later in the day.
His task will be to rebuild and help Italy qualify for the 2020 European Championship, with his first match in charge a friendly on May 28 against World Cup-bound Saudi Arabia in Switzerland.
Italian FA commissioner Roberto Fabbricini said Mancini had proved his "great desire" to become the new Italy coach.
The new coach's first press conference will be held on Tuesday at noon local time at the national team's training centre at Coverciano near Florence.
"It went the way we wanted, we are happy and Roberto is happy," Fabbricini told journalists after the contract was signed in Rome.
"We'll explain everything about the contract tomorrow, he's very happy and so are we."
Mancini will also prepare Italy for a friendly against France on June 1 in Turin, which could be the final international game for goalkeeping legend Gianluigi Buffon.
His first squad will be eagerly awaited and is expected to see the return of Nice forward Mario Balotelli, whom he coached at Inter Milan and Manchester City.
Balotelli has not played for Italy since the 2014 World Cup.
In Mancini, Italy have a coach with a solid track record as a title winner.
He led Manchester City to their first English league title in 44 years in 2012, and won three Serie A titles with Inter Milan.
He also won Italian Cups with Inter, Fiorentina and Lazio.
Since leaving England in 2013, Mancini also managed Galatasaray, whom he lead to a Turkish Cup title, and Inter Milan before joining Zenit in June 2017.
Zenit finished fifth in the Russian Premier League, failing to qualify for the Champions League but qualifying for the Europa League.
Mancini, a former Lazio and Sampdoria forward, had said coaching the national side would be "extraordinary" and would fulfil his dream of winning the World Cup.
He was never a regular with Italy during his 10-year international career, during which he won 36 caps and scored four goals.
He reached the semi-finals of Euro 1988, and was in the squad that finished third in the 1990 World Cup on home soil.
Luigi di Biagio had stepped up from the Under-21s to take interim charge of the senior national side but will now make way for Mancini.