Three-time grand slam tennis champion Andy Murray has undergone hip resurfacing surgery and posted a photo on Instagram from his hospital bed.

A second photo of an X-ray showed a metal joint inserted in the hip of the 31-year-old Briton.

“I underwent a hip resurfacing surgery in London yesterday morning…feeling a bit battered and bruised just now but hopefully that will be the end of my hip pain,” Murray wrote on Tuesday.

“I now have a metal hip as you can see in the 2nd photo.”

Murray, who had been playing under pain from his hip, hopes the surgery could help him play on without pain.

He had already announced he would retire in 2019 but said he would like to play at this year’s Wimbledon tournament. But after losing to Roberto Bautista Agut over five sets in the first round at the Australian Open, he admitted that could have been his final tournament.

“Obviously I’ve been struggling for a long time. I’ve been in a lot of pain for what’s been probably about 20 months now,” he said.

Murray initially had surgery on his right hip in January 2018.

“I’ve tried pretty much everything to get it right and that hasn’t worked,” he said.