Beyazit Square, a windswept plaza behind the book bazaar, abuts Istanbul University, formerly the Ottoman Ministry of Defense compound: a sprawling campus of brick-and-stone buildings and newer, slapdash structures behind a monumental entrance gate. The plaza seethed with protests, riots and army killings during the 1960s and 1970s. Mr. Pamuk was enrolled at the journalism school during one of the most turbulent periods, but while his friends were risking their lives facing down soldiers, he spent most days reading at home in Nisantasi. “I was an ambitious, brainy guy, and university seemed like a waste of time to me.”

A few steps away we ducked into Vefa Bozacisi, another of his favorite places. Founded in 1876, the shop, a cozy establishment with leather banquettes and antique mirrors, specializes in boza, a fermented wheat drink that originated in southern Russia. Mixed with water and sugar and sprinkled with cinnamon, the creamy, butterscotch-colored concoction is served in glasses that were lined up by the dozens on polished wooden counters. Beside shelves of pomegranate vinegar, a case reverently displayed the shop’s most valuable heirloom: a silver boza cup used here in 1927 by Kemal Ataturk.

We entered the grounds of the Fatih Mosque, built on the orders of Fatih Sultan Mehmed, the conqueror of Constantinople, starting in 1463. It was rebuilt in 1771 after an earthquake destroyed it.

In a marble courtyard beside the massive pink sandstone mosque, considered one of the most graceful in the Islamic world, a wall poster caught Mr. Pamuk’s eye. It demanded freedom for Salih Mirzabeyogluna, a radical Islamist and author of incendiary political tracts, who was sentenced to 12 years in prison on a terrorism conviction. Mr. Pamuk — fascinated and disturbed by the rise of political Islam in Turkey and the Middle East — based one of his most memorable characters, the terrorist leader Blue in his novel “Snow,” partly upon Mr. Mirzabeyogluna. Blue is an ambiguous figure: a charismatic intellectual who espouses a violent message, while avoiding direct entanglements in acts of terror. The cases of Mirzabeyogluna and Blue were similar, Mr. Pamuk said. “Some Islamists kill, but he didn’t, but he’s been locked up for a very long time.”

He seemed to tense up slightly as we left the mosque and wandered into one of Istanbul’s hard-core Sunni neighborhoods. “We could be in a different country,” he said in a soft voice. Salafist men with long beards and skullcaps sat on benches in tidy plazas; women in black abayas walked with their children down a cobblestone street past a madrassa, an Islamic school.

The sun had begun to set on this wintry afternoon, bathing the Golden Horn in shadow. We stood in the terraced garden of a mosque, gazing over the landmarks of Istanbul — the red roofs of Cihangir, the 13th-century Galata Tower, one of the few surviving traces of Byzantium. We had been walking for more than four hours, across half a dozen neighborhoods, peeling away Istanbul’s tourist-friendly facade to expose the complex fabric beneath it.

“That’s the beauty of living here,” Mr. Pamuk told me. Then we descended along steep cobblestone alleys leading to the Ataturk Bridge, beginning the long journey home.