John Michael Hayes, a two-time Academy Award-nominated screenwriter best known for his collaboration with Alfred Hitchcock on four films, including "Rear Window" and "To Catch a Thief," has died. He was 89.

Mr. Hayes, who taught screenwriting at Dartmouth College in Hanover, N.H., in the late 1980s and '90s, died in his sleep of age-related causes Nov. 19 at a retirement community in Hanover, said his daughter, Meredyth Hayes-Badreau.

A former writer for radio series, Mr. Hayes had four screenwriting credits when he began his Hitchcock collaboration with "Rear Window."

The 1954 suspense drama starred James Stewart as a photographer who is confined to a wheelchair with a broken leg and, while idly spying on his neighbors across the courtyard of his Greenwich Village apartment building, comes to believe that one of them has committed a murder.

The screenplay, based on a short story by Cornell Woolrich, earned Mr. Hayes his first Oscar nomination.

Mr. Hayes based the character of Stewart's elegant fiancee, played by Grace Kelly, on his wife, Mildred, who was known as Mel.

"The thing was, in the story of 'Rear Window,' there was no woman, and Hitch wanted a woman," Mr. Hayes recalled in a 1999 interview with the Worcester (Mass.) Telegram & Gazette. "He had done 'Dial M for Murder' with Grace Kelly and said, 'We have to have a girl, and I want to use Grace Kelly.' "

Hitchcock, Mr. Hayes recalled, "told me to spend a week or two with her to get to know her, which I did. My wife was a very beautiful girl, a high-style fashion model, so I used the world I knew and I made Grace Kelly a model."

"Rear Window," Mr. Hayes believed, was "technically and every other way" Hitchcock's best film.

"It still has a life of its own," he said in the 1999 interview. "I brought dialogue, character and humor to Hitch. He had the suspense, and we melded very well. He liked my sometimes flippant dialogue, and so did the audience."

The success of "Rear Window" propelled Mr. Hayes to the top echelon of screenwriters.

And for Hitchcock, "the collaboration marked the beginning of his most successful period, critically and commercially," Steven DeRosa wrote in his 2001 book "Writing With Hitchcock: The Collaboration of Alfred Hitchcock and John Michael Hayes."

Despite the success of the Hitchcock-Hayes collaboration, the attention Mr. Hayes received in the media for his screenwriting put a dent in his relationship with the iconic film director.

When Mr. Hayes won an Edgar Award from the Mystery Writers of America for "Rear Window," he brought the small ceramic statuette into Hitchcock's office. After examining it, Hitchcock told Mr. Hayes, "You know, they make toilet bowls out of the same material."

Although Mr. Hayes later said he considered Hitchcock "a joy and a pleasure to work with," their relationship soured over a screen credit dispute on "The Man Who Knew Too Much."

Mr. Hayes was incensed when Hitchcock insisted that he share a screenplay credit with Hitchcock's friend Angus MacPhail, who had written the first treatment for the film. (Mr. Hayes brought the matter to the Writers Guild for arbitration and won sole screen credit, angering Hitchcock.)

Mr. Hayes' adaptation of "Peyton Place," Grace Metalious' bestselling novel of love, lust, incest and murder in a New England village, earned him his second Oscar nomination.

Among his other screen credits are "Butterfield 8," "The Children's Hour," "The Carpetbaggers," "The Chalk Garden," "Where Love Has Gone," "Harlow" and "Nevada Smith."