Dzeko has been linked with moves to both Napoli and Inter Milan in the summer transfer window but has now put to bed any suggestions that a move could be on the cards.
The 33-year-old Bosnia striker has been at the club since the summer of 2015 having joined from Manchester City and has made 179 appearances for the club scoring 87 goals.
Dzeko, whose 29 Serie A goals in the 2016/2017 season was enough to earn him the top scorer award, joins Nicolo Zaniolo and Cengiz Under in signing new deals at the club in the past week.
"Over the last few weeks I have realised just how much the club wanted me to stay," Dzeko told Roma's official website.
"My conversations with the board, the work we've been doing with the coach [Paulo Fonseca], the relationship with my team-mates and the love of the fans has all made me realise once again what I had already learned during these four years – that Rome is my home.
"Here there is everything we need to win something and I am delighted to be able to stay here even longer."
Roma chief executive Guido Fienga added: “Before last season even finished we had reached a decision: Edin would be one of the pillars we would build our new side around.”
“Over the last few months nothing has changed. We are delighted that Edin recognises that if players want to win then Roma is the right place to be.”
Roma will begin their Serie A campaign with a home game against Genoa next weekend.