NEW YORK — Last May, nine months after the knife attack that nearly killed him, Salman Rushdie made a surprise appearance at the 2023 PEN America literary gala. His voice was weak and he was noticeably thinner than usual; one of his eyeglass lenses was blacked out, because his right eye had been blinded in the assault. But anyone wondering whether the author was still his old exuberant self would have been immediately reassured by the way he began his remarks, with a racy impromptu joke.

“I want to remind people in the room who might not remember that ‘Valley of the Dolls’ was published in the same publishing season as Philip Roth’s ‘Portnoy’s Complaint,’” he said, riffing on an earlier speaker’s mention of Jacqueline Susann’s potboiler. “And when Jacqueline Susann was asked what she thought about Philip Roth’s great novel” — with its enthusiastically self-pleasuring main character — “she said, ‘I think he’s very talented but I wouldn’t want to shake his hand.’”

It was classic Rushdie, improvisational literary wit deployed during a solemn occasion, in this case his acceptance of the organization’s Centenary Courage Award.

It was also a triumphant signal that his brush with death — more than three decades after Ayatollah Ruhollah Khomeini of Iran issued a fatwa calling for Rushdie’s killing over the novel “The Satanic Verses” — had dampened neither his spirit nor his determination to live life in the open.

His new book, “Knife,” which will be published Tuesday, is a harrowing account of the attack and its aftermath, and a reminder of how gravely injured he was. It’s also a deeply moving love story that attributes much of his recovery and good spirits to the tender, brave support of his wife of three years, poet and novelist Rachel Eliza Griffiths.“I wanted to write a book which was about both love and hatred — one overcoming the other,” Rushdie said in a recent interview. “And so it’s a book about both of us.”

Nearly a year after the PEN speech, Rushie is still dealing with the physical repercussions of the attack, including bouts of fatigue. One side of his mouth pulls a bit when he talks, the result of damage to a nerve in his neck. His left hand has only partially recovered; his right eye is permanently unusable.

But Rushdie’s voice has regained its rich timbre and air of quick, antic amusement. His manner is just as relaxed, and his mind just as supple, as ever. So easily does he allude to and quote from books and popular culture that it can feel as if everything he’s read and seen and heard is at the forefront of his mind, instantly accessible like some sort of personal Google service.

Though Rushdie considered calling his new book “A Knife in the Eye,” a reference to the worst of his injuries, he decided on a single-word title, as sharp and staccato as the object itself. “Knife” can mean many things, he writes. It’s a weapon, of course, and an artistic device in books, movies and paintings. In Rushdie’s book, it’s a metaphor for understanding.

“Language can be that kind of knife, the thing that cuts through to the truth,” Rushdie said. “I wanted to use the power of literature — not just in my writing, but in literature in general, to reply to this attack.”

On Aug. 12, 2022, Rushdie was onstage at the Chautauqua Institution in western New York — ironically, he was speaking about City of Asylum, a program that provides safe haven to writers under threat — when a black-clad man ran full-tilt onto the stage, wielding a knife. (The man was Hadi Matar, who has pleaded not guilty to charges of second-degree assault and second-degree attempted murder and is awaiting trial.)

The blade struck Rushdie 10 times. It severed all the tendons and most of the nerves in his left hand. It penetrated his right eye just short of his brain, destroying the optic nerve. It slashed into his neck, across his upper right thigh and along his hairline, and pierced his abdomen.

Rushdie remembers thinking two things as he saw the assailant hurtling forward, he writes. The first was that death had finally come for him: “So it’s you. Here you are.” The second was disbelief that it was happening so late in the game, after this long uneventful stretch. “Really?” he thought. “Why now, after all these years?”

As the blows rained down, people rushed to Rushdie’s aid, led by the City of Asylum co-founder Henry Reese, 73, who was interviewing the author onstage and who sustained a shallow knife wound and a badly bruised right eye as he held down the assailant.

“If it hadn’t been for Henry and the audience, I wouldn’t be sitting here writing these words,” Rushdie writes in the book. “That Chautauqua morning I experienced both the worst and best of human nature, almost simultaneously.”

What he feels now is not anger, exactly.

“Obviously I’m not particularly pleased about him,” he said. “And if I gave it some attention, I probably am angry. But where does that get you? Nowhere. And it also becomes a way of being captured by the event, you know, to be possessed by a kind of rage about it.”

His therapist has helped, he said, as has a natural steeliness. “Sometimes you don’t know how resilient you are until the question is asked, until you’re obliged to face very tough things,” he said.

Rushdie is close to his two sons, Milan and Zafar. The loving way he talks about Griffiths reflects a late-in-life contentment after a colorful romantic life featuring four earlier wives, including novelist Marianne Wiggins and celebrity chef Padma Lakshmi. When his family met Griffiths, he said, “they all kind of said, ‘Finally.’”

Rushdie said he wants to be thought of foremost as a novelist. But he has always felt — even before the fatwa — an obligation to be engaged in public matters. For years, he served as president of PEN America, in the forefront of its fights on behalf of free speech.

Presenting Rushdie’s award to him last year, PEN America’s then-president, playwright and novelist Ayad Akhtar, said the group was honoring him “because of what he stood for and continues to stand for, and what this organization is fundamentally all about — freedom.” Akhtar continued: “He has enlarged the world’s imaginative capacities, and at such great cost to himself.”

But Rushdie said that he doesn’t see himself as a symbol of anything.

“I’ve never felt symbolic. I felt — you know, I’m just here.” He laughed. “I’m just Ken.” (This was an allusion to Ryan Gosling’s showstopping song at the Oscars, the night before the interview.) “I’m just me. I’m just somebody who’s trying to be a writer, trying to do his best. And that’s all I’ve ever wanted to be.”