The defending champion had breezed through his opening two matches but found his future in the tournament under serious threat amid a deafening atmosphere on Centre Court.
Fognini is a fiery character and was docked a point for obscene behaviour but had five chances to force a deciding set before Murray fought back to win 6-2 4-6 6-1 7-5.
The world number one now has two days to recover before facing Frenchman Benoit Paire on Monday.
Rafael Nadal struck a blow for Wimbledon’s old guard as he powered through to the second week with a Centre Court beasting of one of the brightest young players in the game.
Twenty-one-year-old Russian Karen Khachanov felt the full force of Nadal for almost an hour before joining the battle too late, as Spain’s two-time champion sealed a 6-1 6-4 7-6 (7/3) third-round victory.
Watched from the Royal Box by his compatriot and friend, the green-jacketed Masters champion Sergio Garcia, Nadal showed why he has won 15 tennis majors in his time and might add another a week on Sunday.
And before Nadal closed out victory there was the opportunity for the crowd to witness the rich promise of Khachanov, one of the men’s tour’s much-vaunted Next Generation pool of players.
He grew into the match and his time will come, but for now the likes of Nadal, Roger Federer, Novak Djokovic and Andy Murray are holding firm at the top, and this was another demonstration of their continuing grip on the game. “For a set and a half I was playing fantastic, and then a little bit worse. But in general terms I’m very happy,” Nadal said.
In the women’s tournament, experience prevailed over youth after five-time Wimbledon champion Venus Williams battled through to the fourth round with victory over Japan’s Naomi Osaka.
The 37-year-old, who won her first SW19 crown in 2000, overcame her powerful teenage opponent 7-6 (7/3) 6-4 on Court One.
The women’s draw is now wide open and some are tipping the elder sister of defending champion Serena for a first title since 2008.
But Williams said: “I just try to play the best I can. I’ve played three matches now, and had zero breathing room in any of them.
“My opponents have played well, served well, competed well in all moments. I’ve had to step it up.
“I imagine that’s going to continue. All I can do is try to be my best.”
She will next face Croatia’s Ana Konjuh, a 7-6 (7/3) 3-6 6-4 winner over Slovakian eighth seed Dominika Cibulkova.
Title favourite Johanna Konta ensured British interest in the second week with a comfortable win over Maria Sakkari.
The sixth seed breezed past her Greek opponent 6-4 6-1 to set up a meeting with Caroline Garcia of France.
“Everyone in the draw is in with a chance of taking the title,” said Konta.
“Favourites also come and go. They change daily, almost.
“I’m just happy to have actually made it into the second week, happy to come through three battles this week.
“I’m very much taking it one match at a time, but definitely working towards staying involved for a full two weeks.”
Garcia was a 6-4 6-3 winner over America’s Madison Brengle, the conqueror of two-time winner Petra Kvitova in the previous round.
Former world number one Victoria Azarenka, in only her second tournament since returning to action after the birth of her son, dashed British hopes of more success with a thrilling win over Heather Watson.
British number two Watson took the first set but Azarenka raced through the second, and in a dramatic finale the Belarussian held her nerve to battle through 3-6 6-1 6-4.
Second seed Simona Halep of Romania was made to work hard by Shuai Peng of China before securing a 6-4 7-6 (9/7) victory.
French Open champion Jelena Ostapenko came through 7-5 7-5 against Italian Camila Giorgi.
Ukraine’s Elina Svitolina, seeded four, also won in straight sets, 6-1 7-5 against Carina Witthoeft of Germany.