Jack Valenti, who became a confidant of President Lyndon B. Johnson and then a Hollywood institution, leading the Motion Picture Association of America and devising a voluntary film-rating system that gave new meaning to letters like G, R and X, died yesterday at his home in Washington. He was 85.

The cause was complications of a recent stroke, his family said. He had been hospitalized in Baltimore in March.

For 38 years, Mr. Valenti was the public face of the movie and television production industry and one of its fiercest advocates. He lobbied Congress to protect filmmakers' intellectual property from piracy and to ease trade barriers overseas. And he fended off lawmakers' recurring campaigns to curb violence and sex on the screen, arguing for free expression. He devised the film-rating system precisely to avoid censorship by local review boards.

He also remained a starry-eyed fan, cherishing his friendships with Kirk Douglas, Sidney Poitier and Frank Sinatra, falling speechless before Sophia Loren and savoring his seconds in the spotlight as a regular presenter at the Academy Awards.

As a Houston political consultant, he was in the motorcade when President John F. Kennedy was shot on Nov. 22, 1963, and he watched as Johnson was sworn in beside Jacqueline Kennedy aboard Air Force One.

Mr. Valenti soon became known, and for a time mocked, for his unfailing loyalty to Johnson, if not outright idolatry of him. ''I sleep each night a little better, a little more confidently because Lyndon Johnson is my president,'' he once said in Boston, inviting guffaws nationwide.

Even after leaving a senior post at the White House in 1966, Mr. Valenti remained at Johnson's service, secretly arranging the president's surprise detour to the Vatican to meet with Pope Paul VI on the way back from Vietnam in December 1967.

His fidelity was lifelong. Mr. Valenti, a bantam 5-foot-7 who forever looked up to the towering Johnson, picked fights with critical Johnson biographers like Robert Caro and Robert Dallek.

Mr. Valenti's forthcoming memoir, ''This Time, This Place: My Life in War, the White House, and Hollywood'' (Crown), does as much to polish Johnson's legacy as his own. He was to have begun a six-city tour on June 5 to promote the book.

In 1966 Mr. Valenti took his talents for personal politicking -- and lionizing his bosses -- to Hollywood, heeding the request of Lew Wasserman and Arthur Krim, then chairmen of MCA/Universal and United Artists respectively, that he take over the Motion Picture Association. ''If Hollywood is Mount Olympus,'' Mr. Valenti once said of his new liege, ''Lew Wasserman is Zeus.'' He became the organization's third president.

At the time, Hollywood was still officially operating under the Hays Production Code, the industry's draconian and increasingly outmoded self-censoring rules that flatly barred nudity, profanity, miscegenation and even childbirth scenes from being depicted on film.

Mr. Valenti was soon confronted with two films in 1966 that convinced him that the code had become obsolete. He dealt with one, ''Who's Afraid of Virginia Woolf?,'' by negotiating a compromise in which three out of four particular vulgarisms were cut.

Later that year, M.G.M. released Michelangelo Antonioni's ''Blowup'' even though that film, showing brief scenes of nudity, lacked Production Code approval. Sensing that other films would also begin flouting the code and in turn create a vacuum into which local politicians and censorship boards might rush, Mr. Valenti decided to act.

''I knew I had to move swiftly, and I did,'' he later recalled. ''I was determined to free the screen from anything like the Hays Code. But I also emphasized that freedom demanded responsibility.''

So by late 1968 he persuaded the national theater-owners association to buy into a system of voluntary ratings, based on an ascending scale of adult content, that would be enforced at the box office: G, M (later PG), R and X.

The system was not without flaws and detractors, and it required some tinkering. In 1984, after receiving complaints about frightening parts of PG-rated movies (''parental guidance suggested'') like ''Gremlins,'' the association added the PG-13 category (''parents strongly cautioned''). Though the other ratings were trademarked, the X was not, and pornographers quickly co-opted it. In 1990 the association replaced the X with NC-17 (no one 17 and under admitted), hoping it would be embraced, but distributors have mostly spurned it for commercial reasons, leaving many filmmakers to make wrenching cuts to adult-themed films in pursuit of an R rating.

Mr. Valenti always rebutted critics by citing an annual survey, paid for by the association, showing that parents of young children strongly believed that the ratings were useful.

In 1983, at the height of the Reagan administration's deregulation efforts, Mr. Valenti led a fight to preserve federal rules intended to protect television producers and studios from the market power of the three major networks. The Federal Communications Commission was considering repealing the rules and allowing the networks to produce programs, thus giving them vertical control over production, distribution and exhibition.