King Bhumibol Adulyadej of Thailand has been treated for hydrocephalus and is now recovering, say Thai authorities.
Hydrocephalus is a condition consisting in an excessive build-up of fluid on the brain.
King Bhumibol, 87, who has been in hospital since May 31, also had a lung inflammation which has since subsided.
The king has had frequent bouts of ill health in recent years.
He is seen as a pillar of stability in Thailand which saw political strife culminating in last year’s coup.
Though the king has no formal political role, he is seen by Thais as a symbol of unity, having ruled since 1946, and his health is closely watched.
In October 2014, King Bhumibol had his gallbladder removed.
The monarch was in Bangkok’s Siriraj Hospital for seven months, and was discharged in May this year, only to return to the hospital a few weeks later for medical tests.