AFL UMPIRE Dean Margetts is recovering in an Adelaide hospital after a medical emergency forced his flight to make an unscheduled landing. 

Margetts had officiated in the Melbourne-St Kilda game at Etihad Stadium on Sunday evening.

He was on a Virgin Australia flight back to Perth, when he became suddenly ill.

The flight landed at Adelaide airport, and Margetts was rushed to the Royal Adelaide Hospital, where doctors discovered a burst stomach ulcer.

AFL umpires boss Wayne Campbell said the veteran whistleblower was doing well and expected to spend the next few days recovering in hospital. 

"Dean experienced some pain in his chest - it got quite bad and there was a doctor on board and he advised the pilot to return to Adelaide," Campbell told AFL.com.au.

"Dean had an operation yesterday morning, which revealed a perforated stomach that was caused by an ulcer.

"He's in good hands, the keyhole surgery was successful and his recovery time will be quicker than it might have been."

Margetts is one of the AFL's most experienced umpires, officiating in over 250 league games, but Campbell said it was "too early to tell at this stage" when the 41-year-old would return to the field. 

"We've got a full complement of 32 listed umpires and we only need 27, so we've got enough umpires to cover him," Campbell said.

"We just want him to focus on his recovery."