Mourinho returns to Italy where he led Inter Milan to the treble in 2010.
"We are thrilled and delighted to welcome Jose Mourinho into the AS Roma family," club president Dan Friedkin and vice-president Ryan Friedkin said.
Mourinho has claimed 25 major trophies in his career to date and joins a club that hasn't won Serie A since 2001.
"When Jose became available, we immediately jumped at the chance to speak with one of the greatest managers of all time," said Roma general manager Tiago Pinto.
Earlier Roma confirmed that Fonseca would leave the club after two years with the three-time Italian champions who are trophyless since 2008.
Roma trail Mourinho's former club Manchester United 6-2 going into Thursday's second leg of their Europa League semi-final in the Italian capital.