Louis J. Lefkowitz, a crack political campaigner who served as attorney general longer than anyone else in New York state history, died late last night at his home in Manhattan. He was 91 years old.

The cause was Parkinson's disease, said his son, Stephen.

Mr. Lefkowitz, a moderate Republican who had been retired and out of the public eye much of the last decade, expanded the role of his attorney general's office during his 22-year tenure, from 1957 through 1978, and earned the unofficial title "the people's lawyer."

It was his glad-handing, back-slapping, knish-gobbling style of retail campaigning -- he was both a mentor and protege of Nelson A. Rockefeller -- that made him a well-known figure to several generations.

"He gave me lessons on how to campaign," said Mayor Rudolph W. Giuliani, recalling Mr. Lefkowitz's work on the hustings with him in 1989, when he first ran for City Hall. "It's a very big loss."

Mayor Giuliani recalled that Mr. Lefkowitz showed him how to remember the names of people he met on the campaign trail. "He told me that when you shake hands with someone, pause and say it to yourself," the Mayor recalled.

The Kings County District Attorney, Charles J. Hynes, who worked under Mr. Lefkowitz as deputy attorney general, called him "the ultimate public man."

"No attorney general before or since has had the impact that Louie Lefkowitz had," he said. "And the recognition he had with people on the street was extraordinary. People always going, 'Hiya Louie.' "

Indeed, "Hiya Louie" was a constant greeting during Mr. Lefkowitz's strolls through New York City, and the easy familiarity he had with voters on the street was what helped him win five terms as a Republican-Liberal in a state that often voted Democratic.

"He taught a whole generation of politicians what street campaigning was," said State Senator Roy M. Goodman of Manhattan.

After 22 years as the chief lawyer for the state government, habitually winning re-election with huge majorities, Mr. Lefkowitz shifted in 1979 to a busy retirement. Practicing politicians sought his advice and endorsement, and honors were heaped on him. His heart, however, remained in the personal, deal-making politics of the Lower East Side.

He never apologized for the old style, either. In fact, he was proud of it. "There was more discipline, more loyalty," he once said. "People complain now about the old clubhouses, but they served the people, especially in the minority neighborhoods.

"Where I came from, there were the Jews and the Italians and the Irish, and we helped them to become citizens, taught them a little history."

But for years, as reform, television and the movement of new sorts of people into New York politics brought that style into some disrepute, the image persisted that Mr. Lefkowitz was a party drudge.

When he was initially proposed for appointment by the Legislature as Attorney General late in 1956, the incumbent, Jacob K. Javits, who was stepping up to United States Senator, let it be known that Mr. Lefkowitz was not quite the sort he had in mind as a successor.

The awkwardness from that situation faded with the years, as Mr. Lefkowitz and Mr. Javits jointly approached the status of elder statesman and came to appreciate each other's talents.

Both were members of the remarkable turn-of-the-century generation who turned to the settlement houses to escape their slum roots.

"They were havens," Mr. Lefkowitz once said. "You had gymnasium privileges, swimming. You could take a bath more often than at home."

He joined a club called the Solons at the University Settlement. Some friends from the group helped when, urged by the neighborhood Republican leader, Samuel S. Koenig, he ran for the Assembly at the age of 23.

Relentlessly, he knocked on doors, a Republican in a fanatically Democratic district, telling the neighbors that whatever happened, he did not want to be humiliated.

"You'll be told Louie Lefkowitz is hopeless and just wasting his time," he told the neighbors. "So just help me get a respectable vote."

They obliged by electing him.

Gov. Alfred E. Smith called him in when he got to Albany.

"You're the young men who got elected from the Lower East Side?"

"Yes, sir."

"Don't ever get elected again."

"What?"

"As a Republican," the Governor said with a laugh.

But the normal political proclivities of the Lower East Side soon took over, and the Governor's party took back the seat. Mr. Lefkowitz began decades of service as a Republican functionary, the party's Election Law expert.

He was rewarded with a series of appointive jobs, until he was promoted to Attorney General and proceeded to make that job his own.

For a man consistently on public view, he kept his private life consistently private. He and other young lawyers rented a summer cottage in New Jersey in 1926, and he met Helen Schwimmer, a secetary sharing a similar cottage with friends.

They married five years later. Mrs. Lefkowitz had a career as an artist and stayed away from the political world.

Mr. Lefkowitz was also well known for broadening the scope of the attorney general's office. "Historically, the attorney general's office played a defensive role -- defending the state whenever the state was sued," Robert Abrams, Mr. Lefkowitz's successor, said today in praising him.

"In the modern era," Mr. Abrams said, "it began to take the offensive lead on behalf of the public interest by bringing lawsuits. He took a particular lead in doing that in the consumer protection area."

Politically, Mr. Lefkowitz built immense popularity, winning when Governor Rockefeller did at the top of the Republican ticket in 1958, 1962, 1966 and 1970, and winning when Malcolm Wilson lost at the top in 1974. His only loss was in 1961, when he ran for mayor and the Democrat, Robert F. Wagner, won a third term.

"He was an intimate of Rockefeller," Senator Goodman recalled. "He used to stay in the Executive Mansion with Rockefeller in Albany, one of the few people ever allowed to do that." He also taught Mr. Rockefeller how to eat blintzes, the Senator added.

The joy seemed to fade from the state job after Mr. Rockefeller left.

Of a political school that believed in amiable accommodation, Mr. Lefkowitz did not like the mercurial style of Gov. Hugh L. Carey and did not relish the idea of four more years of joint tenancy with Mr. Carey at the top of the state goverment.

Accustomed as the years went by to relatively subservient challenges by Democratic opponents, he did not like the pugnacious tactics Mr. Abrams used in running against him, unsuccessfully, in 1974.

So he called a news conference early in 1978 and announced he would not seek a sixth term that year. He retired into the same busy life permeated with politics that he had practiced almost since childhood.

Besides his son, of Manhattan, Mr. Lefkowitz is survived by a daughter, Joan Feinbloom of Rochester, N.Y., and two grandsons. His wife, Helen, died in 1986.

Photo: Louis J. Lefkowitz, left, with Gov. Nelson A. Rockefeller in1973. His career as attorney general spanned 22 years and three governors. (Associated Press)