The former world number one beat 24th seed Nikoloz Basilashvili on the first day of the tournament, as he powered through a 6-4, 6-3, 5-7, 6-3 victory.
The 34-year-old, who is playing his first singles match at Wimbledon since 2017, looked set to cruise over the line when he led by two sets and 5-0 in front of a raucous crowd.
But Murray faltered within sight of the line, Basilashvili found renewed hope and he reeled off seven games in a row, saving two match points, to force a fourth set with darkness closing in.
Murray regrouped, moved back in front and this time finished the job off, making it the ultimate comeback for the three-time major champion - who has had two operations since he limped out at the quarter-final stage four years ago.
Murray has also had a hip resurfacing operation which involves inserting a metal rod into the femur and coating the joint in metal.
He has endured a succession of injury issues which have restricted his ability to put together a number of matches in the past.
A total of 10 British players played on Monday, including 19-year-old Jack Draper, who lost to reigning champion Novak Djokovic in the men's draw.
Those attending the All England Club were hit by a delay to proceedings due to the poor weather in London.
Rain stopped any play taking place before 1pm on Monday but the it was worth the wait for many as they witnessed Djokovic defeat Brit Draper, who started well by winning the first set against the world No 1 before eventually succumbing to the Serb.
Later on, Dame Sarah Gilbert, one of the scientists who worked to create the Oxford/AstraZeneca Covid-19 vaccine, was given a standing ovation at Wimbledon as she watched the first day of the championship from the Royal Box on Centre Court.
The crowd applauded and cheered the jab co-designer and her colleagues along with medical staff and other "inspirational individuals", in honour of their work to defeat Covid.