The African leader announced last month that he had begun treatment for cancer.
Namibia's President Hage Geingob has died at the age of 82, his office said, less than three weeks after it was announced he would undergo cancer treatment.
Geingob died on Sunday at the Lady Pohamba Hospital in the capital Windhoek with his wife and children by his side, acting president Nangolo Mbumba said in a statement posted on Geingob's official Facebook page.
“The nation of Namibia has lost a distinguished servant of the people, an icon of the liberation struggle, the chief architect of our constitution and the pillar of the house of Namibia,” Mbumba said.
“At this time of deep grief, I appeal to the nation to remain calm and collected while the Government takes care of all necessary state arrangements, preparations and other protocols. Further announcements will be made in this regard.”
Geingob's office announced last month that he had begun treatment following the discovery of “cancer cells” during a routine colonoscopy and gastroscopy.
The announcement did not provide details about the African leader's diagnosis or prognosis, but said he would continue to carry out his presidential duties.
Geingob's office later announced that he would travel to the United States for medical care and return to Namibia on February 2.
Geingob, who also served 12 years as prime minister, had a history of health problems that preceded his election as Namibia's third president in 2014.
In 2013, the anti-apartheid activist-turned-politician underwent brain surgery and revealed the following year that he had survived prostate cancer.
Last year, Geingob announced that he had undergone aortic surgery in neighboring South Africa.
Namibia, a former German colony that gained independence from South Africa in 1990, will hold presidential and parliamentary elections in November.
Geingob was not eligible to run for re-election as Namibia's constitution limits the president to a maximum of two terms.
The ruling SWAPO party's presidential candidate, Nandi-Ndaitwah, would be the country's first female head of state if elected.