The fourth seed had to recover from losing the second set to claim a memorable win under the roof on Centre Court with added drama due to the contest finishing fractionally after the tournament’s curfew.
All England Club officials were poised to take the players off with a possible resumption on Monday, but Murray sealed a breathless win just in time to set up a fourth-round clash with Marin Cilic.
It was an incredible finale to a match which took three hours and 13 minutes to be completed after it began at 19:15 with play having to be halted for over half an hour as the roof was closed at 21:00.
Murray and Baghdatis had a 3-3 head-to-head record coming into the match, with the Cypriot having won their one previous encounter at Wimbledon in straight sets back in 2006.
The world number 42 began rather sluggishly on serve and was mightily relieved to see Murray plant successive forehands into the net tamely from 15-30 in the opening game.
Murray, who won their solitary match so far this year in Brisbane, was suddenly put under huge pressure serving with new balls at 4-3 down as Baghdatis forced two break points.
The fourth seed saved the first with an audacious drop shot, before a crucial Hawkeye review assisted him in taking the game to deuce in an increasingly tense atmosphere on Centre Court. A relieved Murray eventually came through after deuce to hold.
The 27-year-old from Limassol found himself under the cosh in the next game, but pulled through with a sparkling forehand as Murray moved in court to harry his opponent.
Both players, renowned for their skill in returning, applied big pressure on the other’s serve, but a break of serve did not come until the first set was locked at 5-5 as Murray seized the initiative.
Baghdatis was outmanoeuvred in what was a lengthy deuce as Murray broke serve in clinical fashion before serving out for the opening set, with his first ace of the match providing the final flourish.
The Cypriot was forced to save two break points in the third game of the second set as Murray piled on the pressure from the back of the court, but he finally caved in as the fourth seed grabbed the early advantage.
Murray twice took a tumble in the next game as he traded groundstrokes with his opponent from behind the baseline with some lengthy rallies taking their toll on both players, and a sloppy double-fault gave Baghdatis an immediate break back.
Neither player was showing much conviction as unforced errors abounded with Baghdatis saving a series of break points on his next service game, while Murray’s frustration continued to grow as his early advantage was eroded.
Baghdatis suddenly had the momentum in the match, and he broke for a second successive game as Murray’s misery was compounded with a number of nasty slips only serving to add to his problems.
The Cypriot closed out the second set in nerveless fashion before the tournament organisers halted the match in order to close the roof of Centre Court. It was a delay that Murray appeared to need as he struggled to contain his frustration.
After 36 minutes off court, Murray held serve in very convincing fashion with Baghdatis following suit, before the world number 42 seized control of the set in the fifth game as he broke the Brit with a stunning backhand to seal it.
Murray was undeterred, however, and broke back to level at 4-4 with a brilliant resurgence as the Centre Court crowd willed the Brit to find something special in response. A resurgent Murray proceeded to hold serve to love.
Baghdatis again forced break points at 5-5 but Murray held firm and, despite being penalised for a ball dropping from his pocket onto court on a second occasion, he was able to come through and hold before a stunning backhand pass gave him the crucial break in the next game.
After taking the third set in such dramatic fashion, Murray continued his momentum as he held serve at the start of the fourth and suddenly it was Baghdatis slipping and falling over on the court.
Murray broke his opponent’s serve in the second game of the set, and suddenly the crowd sensed that he would wrap up victory in the nick of time as tournament officials loitered on the sidelines.
Baghdatis could only muster a single game in the fourth set as Murray broke again to lead 5-1, and he was roared on to complete a dramatic victory with a hasty hold as the clock ticked past 11pm.
It was a thrilling finale to the match as Murray avoided a return on Monday with the fourth seed to face Marin Cilic in the next round after the Croat overcame American Sam Querrey in an incredible 17-15 final set.