Dr Hossam Mowafi, head of a medical team supervising his treatment at the Police hospital, said Mahfouz died on Wednesday morning after a sharp decline.
Mahfouz, 94, had been in intensive care since suffering a sudden drop in blood pressure and kidney dysfunction.
He had been hospitalised on July 19 after he fell in the street and sustained a deep head wound that required immediate surgery.
The Egyptian author won the Nobel Prize in 1988 - the first writer in Arabic to win the award - and is best known for his Cairo Trilogy in which he narrated developments in Egypt through the eyes of a middle class family over three generations.
Mahfouz was admitted to hospital regularly in recent years, most famously after being stabbed in the neck in 1994 by Muslim militants because of his portrayal of God in one of his novels.
He spent seven weeks in hospital and the knife damaged a nerve, seriously impairing his ability to use his writing hand.
Across the span of 50 novels, five plays and scores of short stories and essays, Mahfouz depicted with startling realism the Egyptian "everyman", balancing between tradition and the modern world.
Often the scene of the novels did not stretch beyond a few familiar blocks of Islamic Cairo, the 1,000-year-old quarter of the capital where Mahfouz was born.
Mahfouz studied English at King Fouad University, now Cairo University, graduating with a philosophy degree in 1934.
"He is a great son of Egypt, a patriot in the fullest sense of the word"
Raymond Stock, Mahfouz's American biographer
Mahfouz was strongly political, but kept to a moderate line. He was a great defender of the Palestinian right to an independent state and a critic of US foreign policy in the region, particularly over Washington's support for Israel and occupations of Iraq and Afghanistan.
But unlike the majority of novelists, writers and artists, Mahfouz has been a supporter of the peace treaty between Egypt and Israel since it was signed in 1979.
Several of his works were made into movies. For many Arabs, his characters can never be separated from the voices and faces of some of Egypt's most popular actors.
Raymond Stock, his American biographer and translator of some of his works, said Mahfouz's legacy is to leave great novels and convey his "great love of Egypt".
"He is a great son of Egypt, a patriot in the fullest sense of the word."