The African leader announced last month that he had started treatment for cancer.
Namibia's President Hage Geingob has died at the age of 82, the presidential palace announced, less than a month after it was announced he was undergoing treatment for cancer.
Acting President N'Golo Mbumba announced in a statement posted on Geingob's official Facebook page that Geingob died on Sunday at Lady Pohamba Hospital in the capital Windhoek, surrounded by his wife and children.
“The Namibian nation has lost a distinguished servant of its people, a symbol of the liberation struggle, the chief architect of its constitution and the breadwinner of the Namibian family,” Mbumba said.
“At this moment of deepest sadness, I appeal to the public to remain calm while the government takes note of all necessary national arrangements, preparations and other protocols. Further announcements will be made in this regard. It is scheduled to take place.”
Geingob's office announced last month that the African leader had discovered “cancer cells” during a routine colonoscopy and gastroscopy and had begun treatment.
His office announced days later that he would travel to the United States for treatment and return to Namibia in February.
Mr Geingob had health problems before being elected as Namibia's third president in 2014.
Last year, he underwent aortic surgery in neighboring South Africa, and in 2014 he announced that he had survived prostate cancer.
Namibia is a former German colony that achieved independence from South Africa in 1990, and presidential and parliamentary elections are scheduled for November.