A. Stanley Tretick, 77, the former Look magazine photographer whose intimate portraits of President John F. Kennedy and his children are among the classic images of American photojournalism, died July 19 at the health care center of Asbury Methodist Village in Gaithersburg. He had suffered strokes.

Mr. Tretick's picture of John Kennedy Jr. as a toddler, peering out from a small door in the front of the presidential desk, has had a poignant return to the news in recent days, as searchers looked for Kennedy's missing plane.

A month before he was assassinated in Dallas, the president invited Mr. Tretick to the Oval Office to photograph the children. The two men had conspired to wait until Jacqueline Kennedy was out of the country, according to writer Kitty Kelley, Mr. Tretick's close friend.

"Jackie was so adamant against the children being photographed and used for political purposes," Kelley said. "The president understood the use of these adorable children, so when she left, the two of them, like Tom Sawyer and Huck Finn, did it."

Kelley said the Look edition with the photographs hit the newsstands several days after the assassination, but an advance copy traveled with the Kennedys on Air Force One.

"Jackie later told Stanley how happy she was that the president and Stanley hadn't listened to her," Kelley said. "If they had, she would not have had the photographs. This is a refrain in memos and letters later between the two of them."

In the years after the president's death, Mr. Tretick was invited to accompany Mrs. Kennedy and the children on trips and took additional pictures for Look. Her favorite Tretick photograph, Kelley said, was an old one from the presidential campaign, an unusually intimate shot of the president reaching over in the front seat of a convertible to brush the hair out of his wife's eyes.

Mr. Tretick was also close to the president's brother, Robert; his picture of him standing, with his arms crossed, was eventually used on a postage stamp. Other memorable Tretick photos of the Kennedys included a campaign picture of JFK, standing on the hood of a car amid a sea of hands reaching up to touch him.

He also photographed the president driving a golf cart full of Kennedy children and cousins. The photo is displayed prominently at the Kennedy Library in Boston and at the Time magazine bureau in Washington.

Mr. Tretick was born in Baltimore and raised in Washington, where he lived for most of his life. He was a graduate of Central High School. He was trained as a photographer by the Marine Corps and served in the Pacific during World War II.

Mr. Tretick worked early in his career for the Acme News Service and for The Washington Post, where he was a copy boy. He joined United Press around 1950 and was assigned to battlefield coverage of the Korean War. Later assignments included Capitol Hill and presidential campaigns.

He left what had become United Press International for Look to cover the Kennedys in 1960 and continued with the magazine until it folded in the 1970s. After that, he was a founding photographer of People magazine. He retired in 1995 as a contributing photographer.

In addition to his news work, which appeared in Life magazine and other publications, Mr. Tretick did special still photography for more than 30 movies, working with Warren Beatty, Robert Redford, Dustin Hoffman and others. He did still work for movies that included "All the President's Men," "Reds," "The Candidate" and "Electric Horseman."

He also contributed photographs to three books, "A Very Special President," about Kennedy, "They Could Not Trust the King," about President Richard M. Nixon and Watergate, and "A Portrait of All the President's Men," the story behind the film.

He was a member of the White House News Photographers Association and the American Society of Magazine Photographers.

Mr. Tretick's marriages to Dorothy Tretick and Maureen Tretick ended in divorce. Survivors include a brother, Gordon Tretick of New Jersey.

CAPTION: One of A. Stanley Tretick's most famous pictures is this one of John F. Kennedy Jr. playing under the desk in his father's White House office. (1963 photo)