Ranieri, 67, was sacked by Fulham eight days ago after winning three of his 17 games in charge of the club.
But the AS Roma fan – who managed the club between 2009 and 2011 – has been handed a quick return to management, replacing Eusebio di Francesco.
“I’m delighted to be coming back home,” Ranieri said on Friday. “When Roma call you, it’s impossible to say no.”
Di Francesco was sacked on Wednesday after losing 4-3 on aggregate to Porto in the Champions League last 16.
AS Roma sporting director Monchi also left the club earlier on Friday.
Claudio Ranieri took over at Fulham last November after the sacking of Slavisa Jokanovic and beat Southampton 3-2 in his first game, but 11 defeats followed including an FA Cup third-round exit at home to League Two side Oldham. Ranieri left the Cottagers after just 106 days with the club 19th in the Premier League, 10 points from safety with 10 games left.
AS Roma president Jim Pallotta said: “We are delighted to welcome Claudio Ranieri back to the club.
“We have one objective remaining this season and that is to finish in the highest possible league position and secure qualification for the Champions League.”
Roma are three points behind fourth-placed Inter Milan, who occupy the last Champions League spot.
Ranieri famously led Leicester to the 2016 Premier League title despite starting the season as 5,000-1 outsiders.
Ranieri return to Roma will be his eighth spell as a manager in Serie A – and first since he was sacked by Inter Milan in 2012 – and his 19th managerial job in total.