A single break in each of the first two sets put the 13th-seeded Italian into a commanding lead and despite a dominant third-set tiebreak win by Murray, Berrettini rebounded to take the fourth.
Berrettini fires into second week against valiant Murray
Berrettini had the first look at a break point in the third game of the match, but the Italian sliced a backhand into the top of the net, Murray eventually holding.
The Brit would get his own chance to break later in the set, but a Berrettini forehand wiped the opportunity away.
The 13th seed was gifted the break in the next game as Murray double-faulted on break point and three games later,
Breaks were traded to open the second set and following that, each man held serve when Berrettini was given an opening in the ninth game and following a double fault by Murray, the Italian went in front 5-4.
Serving for the set, Berrettini jumped out to a 40-0 lead and while Murray saved the first, he couldn't save the second as the 13th seed now held a commanding two-set lead.
Facing break points in each of his first two service games of the third set, Murray dug deep both times and held onto his serve to take a 2-1 lead.
At 5-5, the 2012 champion again escaped from 15-40 down to hold and after Berrettini forced a tiebreaker, it was Murray who won the final seven points of the breaker to clinch the set and haul himself back into the match.
Breaks were exchanged to open the fourth set and the Brit had the next chance to seize the lead in the seventh game, but the opportunity slipped away and he was broken to 15 in the next game.
Serving for the match, Berrettini lost the first point, but rallied to win the next four and claim a spot in the Round of 16.