Neil Patrick Harris' husband has undergone "intensive" spinal surgery.

Neil Patrick Harris and David Burtka

Neil Patrick Harris and David Burtka

The 'It's A Sin' actor's spouse, David Burtka, is recovering after the lengthy procedure to tackle three troublesome discs in his back and the 47-year-old actor admitted it had been scary having to sit and wait for news on the 45-year-old chef while he was in hospital.

Neil shared a photo of David in hospital giving a double thumbs up and wrote on Instagram: "David is recovering from spinal surgery. It was fairly intensive, took over seven hours, but he’s in good spirits and doing well.

“It’s one of the scarier, more hopeless feelings – hoping for the best, trying not to fear the worst, waiting a call with news. Thankfully, all went according to plan. Whew..! Two thumbs up. I love you, @dbelicious. Your strength inspires me. And thanks to NY-Presbyterian Hospital for, well, everything. [heart and prayer emojis] @nyphospital (sic)"

The 'How I Met Your Mother' star then gave some more details on the operation when actress Amy Sedaris asked in the comments what had happened.

He replied: "It was planned for a while. Three disks being d****. #triplefusion (sic)"

Neil later shared a video of him visiting David after the surgery, with his husband "in and out of lucidness" thanks to his pain medication.

Gesturing to his neck brace, David said in the clip: "This is the new fashions for 2021. I'm gonna bedazzle it when we get out of here and I'm going to have one those 'Hello my name is David, I'm here to serve you.' "

Neil explained: "He's going in and out of lucidness. And he has a button that he pushes."

David then said: "I think it's time to push the button, where's my pain pill? Watch this.... Morrrrppphine. I dunno, I assume it is?"

When Neil asked his spouse how the medication made him feel, he replied: "Like the bottom of the ocean."

The actor - who has 10-year-old twins Gideon and Harper with David - captioned the post: "A few hours after surgery. Not sure David will remember saying any of this… but damn, it makes me laugh.

“I appreciate his positive energy so so much. @dbelicious @nyphospital #morphine.(sic)"