text: Media playback is not supported on this device
  The Briton, 30, won 6-2 4-6 6-1 7-5 after two hours and 39 minutes, with match point clinched at 20:57 BST.
  Fognini, the 29th seed, had five set points to force a fifth set but Murray won five games in a row to seal a place in the last 16 for the 11th time.
  Murray will play Frenchman Benoit Paire in the fourth round on Monday.
  Fellow Briton Johanna Konta earlier reached the second week for the first time with a 6-4 6-1 win over Maria Sakkari of Greece.
  Media playback is not supported on this device
  "The end of the match was tense. It was an up and down match. I didn't feel like it was the best tennis at times but I managed to get through," Murray told the BBC.
  "It was getting dark towards the end and I was probably thinking a bit about that.
  "We would have had to go off for the roof to go on, so that would have meant a change in conditions. I'm pleased to get off in four."
  Media playback is not supported on this device
  Murray looked like avoiding a long, drawn-out contest when he moved ahead early in the third set but a Friday night drama would develop as the light faded.
  Fognini, 30, showed both his talented and temperamental sides as he got within sight of a fifth set, which would have required the roof to be brought across or both men to return on Saturday.
  The Italian, who recently beat Murray on clay in Rome, looked well off the pace when he double-faulted twice in a row to lose the first set, but he began to assert himself in the second.
  Fognini broke for a second time to lead 3-2 and went on to level at one set all, before firing his 13th baseline winner to just one for Murray by the start of the third set.
  At 30-30, Murray was on the defensive and looking increasingly vulnerable, but he clung on with a second serve and the scream of relief jolted him and the Centre Court crowd to life.
  Across the net, Fognini's challenge was apparently fading, an ankle injury not helping as the errors flowed and the set slipped away.
  A gripping fourth set unfolded, with passions rising on and off court as Fognini was penalised a point for a visible obscenity following a gesture, and Murray complaining to the umpire that the Italian was taking too long between points.
  It was Fognini who took control after Murray double-faulted in game six, but from 5-2 down Murray showed all his fighting qualities to save set points in three consecutive games.
  The 15,000 spectators on Centre Court were on their feet as the Briton levelled at 5-5, and Fognini could not halt Murray's momentum as the champion served his way to victory.
  "I feel OK," added Murray. "I didn't feel I moved as well as the first couple of matches but I've got a couple of days break now and can work on that and hopefully get myself in a good rhythm and play some good tennis on Monday.
  "I'm happy to get through the first week and anything can happen from here on."
target: Defending champion Andy Murray won a thrilling third-round contest against Italy's Fabio Fognini at Wimbledon as darkness fell around Centre Court.