The deal was confirmed by Lazio president Claudio Lotito yesterday.
Marchetti, frozen out for much of last season, was punished for telling journalists he wanted a more ambitious outfit after the World Cup, as offers to buy him were rejected.
“I paid a very heavy price for my dream of wanting to play in the Champions League,” Marchetti told the Gazzetta dello Sport.
“There was a misunderstanding. I owe a great deal to Cagliari and President Massimo Cellino, who apologised to me personally. They believed in me and I will not forget that.”