The funeral of Egyptian writer Naguib Mahfouz, who has died aged 94, has been held in Cairo's old district - an area that featured heavily in his novels.
Naguib Mahfouz requested a funeral at the historic Hussein mosque
A public service was held at al-Hussein mosque in accordance with Mr Mahfouz's wishes, before his coffin was moved to another mosque for a military funeral.
His death has dominated Egyptian media, and tributes have been pouring in from world leaders and literary figures.
A Nobel Prize laureate, Mr Mahfouz is hailed as the father of the Arab novel.
He died on Wednesday, several weeks after he was taken to hospital following a fall.
His coffin, draped in a green shroud, was accompanied into the historic Hussein mosque by friends and admirers chanting "to eternal Heaven, Naguib".
The busy alleyways, markets and Islamic monuments around the mosque in Cairo's old quarter were the setting for many of his novels.
Prayers were led by Egypt's most senior religious figure, Mohammad Sayyid Tantawi, sheikh of the al-Azhar mosque.
"We give Naguib Mahfouz over to God, and ask Him to forgive his soul with His blessing and forgiveness, and to forgive his sins, and to accept him in heaven," he said.
Many Egyptians have been mourning Naguib Mahfouz's death
The writer had often angered conservatives with his calls for religious tolerance. In 1994, he was stabbed by an Islamist extremist angered by his portrayal of God in one of his novels.
Egypt's Religious Affairs Minister, Hamdi Zaqzouq, said Mr Mahfouz was considered a "national symbol of the Arab arts".
"He transformed Arabic literature from the local to the universal and he enriched it with his ideas. Naguib Mahfouz's influence will endure, especially in the field of the Arabic novel," he said.
From the Hussein mosque, the coffin was moved to a mosque in Cairo's Nasr city neighbourhood for a military funeral attended by President Hosni Mubarak.
Mr Mubarak and other officials walked behind the coffin, by now draped in an Egyptian flag, as it was carried in a horse-drawn gun carriage.
Mr Mahfouz is the only Arab writer to have won the Nobel Prize for literature, which he received in 1988. Especially commended was his vivid portrayal of Egyptian life in his Cairo Trilogy.
Over his long career, he published more than 30 novels, short stories, plays, newspaper columns, essays, travelogues, memoirs and political analyses.