"I'm delighted to be coming back home," Ranieri said. "When Roma call you, it's impossible to say no."
Roma president Jim Pallotta said Ranieri has been hired because he understands the club.
"We are delighted to welcome Claudio Ranieri back to the club," Pallotta said. "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.
"At this stage of the campaign, it was important to bring in a coach who knows the club, understands the environment, can speak the language and is able to motivate the players. Claudio ticks all of those boxes and he's very excited to take on this challenge."
Meanwhile, club icon and director Francesco Totti said he is delighted the club has hired a "safe pair of hands."
"Claudio's from the city, he's a Roma fan but more than that, he's one of the most experienced coaches in world football," Totti said. "What we need now is a safe pair of hands to guide us back into the top four and ensure that we are playing Champions League football again next season. We have 12 games left and we need to win as many of them as possible."
Ranieri has returned to management just eight days after being dismissed by Premier League side Fulham where he picked up just three wins in 16 matches.
Roma sit fifth in Serie A -- three points off the final Champions League place -- and welcome 17th place Empoli to the Stadio Olimpico on Monday.
Di Francesco was dismissed following two season-defining defeats in five days after they lost 3-0 to Lazio in the derby before bowing out the Champions League in the round of 16 -- losing 4-3 to Porto on aggregate after extra-time.
This will be Ranieri's second spell in charge of Roma. His first came between 2009 and 2011, when he replaced Luciano Spalletti early on in the season.
He led them to a second-place finish in 2010, with 80 points -- just two fewer than eventual Treble-winners Inter Milan -- but resigned the following February after Roma threw away a 3-0 lead to lose 4-3 to Genoa, and Vincenzo Montella replaced him.
In those years, he coached a team featuring captain Daniele De Rossi and Totti.
Roma, who have not won a major trophy since their Coppa Italia success in 2008, will be hoping Ranieri can replicate his 2016 Premier League-winning achievement with Leicester and lead the club to a first Serie A title since 2001.
ESPN FC's Italy correspondent Ben Gladwell contributed to this report