Because he opposed Islamic fundamentalists, including the banned Muslim Brotherhood, Mr. Ghitani sometimes found himself endorsing alternatives that might not otherwise have been palatable. He firmly supported the army since the fall of Hosni Mubarak in 2011 and defended its ouster of Mohammed Morsi, the Islamist president, in 2013, despite repressive measures that followed.

After a series of terrorist attacks in Cairo in 1993, he explained: “In the battle between a religious extremism and terrorism seeking to bring down a corrupt and basically repressive government, the choice for many of us, lamentable though it may be, is to side with army and regime.”

But as a writer and editor he was also a fervent defender of artistic freedom.

When an Egyptian court found a novel by Alla Hamed blasphemous to Islam in 1992 and sentenced the author to prison, provoking international protests, Mr. Ghitani dismissed the book, “The Distance in a Man’s Mind,” as mediocre, but said: “We cannot allow religious authorities to censor our creative and intellectual work. I am not defending Mr. Hamed now; I am defending myself.”

And in 1994, when a member of Parliament criticized the reproduction of a Gustav Klimt painting of Adam and Eve in a publication that Mr. Ghitani edited, he responded: “Unless every owner of a pen or a brush and every innovator stands up to such attacks, no one will be able to write a word, compose a tune or paint a color.”

In 2006, when Egypt’s leading Islamic jurist declared that exhibiting statues at home was forbidden, Mr. Ghitani declared, “It’s time for those placing impediments between Islam and innovation to get out of our lives.”