King Salman bin Abdulaziz, Saudi Arabia's ruler, sent out Eid greetings after the 84-year-old left the hospital following a gallbladder surgery.
"The Custodian of the Two Holy Mosques, King Salman, leaving the hospital after God blessed him with health and wellness," state media said in a caption accompanying photos of the monarch walking out of the building.
The foreign ministry also tweeted a video of the king leaving the hospital, walking with the aid of a cane and accompanied by a retinue including his son Crown Prince Mohammed bin Salman.
The royal court said a week ago that he underwent laparoscopic surgery to remove his gall bladder at King Faisal hospital in Riyadh.
It is rare for Saudi Arabia to report on the health of the ageing monarch, who has ruled the top oil exporter and the Arab world´s biggest economy since 2015.
However, the king's hospitalisation prompted Iraqi Prime Minister Mustafa al-Kadhemi to postpone his scheduled visit to Saudi Arabia.
A video released by state media shortly after the announcement showed the monarch chairing a virtual cabinet meeting from hospital, in an apparent effort to dispel rumours about his health.
In 2017, Saudi Arabia dismissed reports and mounting speculation that the king was planning to abdicate in favour of Prince Mohammed, who is seen as the de facto ruler.
Under the king's rule, Saudi Arabia has launched ambitious economic reforms for a post-oil era and given more rights to women, but also adopted a more assertive foreign policy and entered a war in neighbouring Yemen.
The king is the second reigning monarch in the Gulf to be hospitalised recently, after Kuwait's 91-year-old emir Sheikh Sabah al-Ahmad Al-Sabah, amid the twin regional crises of the coronavirus pandemic and a plunge in crude prices.