Actor Johnny Ruffo thought he had a "migraine". He needed emergency surgery.

Former Home and Away actor Johnny Ruffo had the shock of his life when he went to the hospital complaining of a “migraine” and learned he needed emergency surgery to remove a brain tumour.

The 2011 X-Factor finalist shared the results of the surgery with fans, posting a photo of a gruesome-looking scar on Instagram on Thursday.

“Some things in life really put things into perspective. Hoping for a positive result. Keep me in your thoughts,” he wrote next to the image.

In a statement, the 29-year-old said that on Sunday he went into hospital with a migraine.

"Keep me in your thoughts." (Image via Instagram.)

"I had to have emergency surgery to have a brain tumour removed," he said.

"I am on the mend and feeling positive."

His former co-star, Lynne McGranger, who plays Irene Roberts on Home and Away, told News Corp she and the rest of the cast were "shocked to hear of Johnny's sudden illness."

"It goes without saying that he is so loved and we wish him a speedy and complete recovery and can’t wait to see him tearing up the stage again soon."

Ruffo appeared as Chris Harrington on the Australian soap series from 2013 to 2016.

Listen: Carrie Bickmore talks about her charity Beanies 4 Brain Cancer, and all things parenting and work on I Don't Know How She Does It.