ALBANY – The late comic Lenny Bruce, who inspired generations of anything-goes standups, received a posthumous pardon yesterday from Gov. Pataki, almost 40 years after he was arrested on obscenity charges.

“It’s a little late, but I’m sure Lenny Bruce would say, ‘It’s about time,’ ” veteran comic Tommy Smothers told The Post. It was the first time in state history that a New York governor granted a pardon to someone who had died.

The campaign for Bruce’s pardon was supported by his ex-wife and daughter, First Amendment activists and comedians like Robin Williams, the Smothers Brothers and Penn and Teller.

Bruce’s former lawyer, Marty Garbus, said the pardon would have both delighted and infuriated his client. “If Bruce were here today, he’d be laughing and furious,” he said. “He was in bad shape, but it was the New York case that killed him. It was the New York case that sealed off his income.”

The groundbreaking comic was arrested for a performance that he gave in 1964 at the Cafe Au Go Go in Greenwich Village.

During his edgy political commentary, the foul-mouthed Bruce admired the size of Eleanor Roosevelt’s breasts and said Jackie Kennedy was seeking to escape – not seeking help – when she tried to crawl out of the limo after JFK was shot.

Undercover cops who attended the performance claimed he used more than 100 “obscene” words in his act – words that today are freely spoken by comedians on cable TV.

“Times change, and people in the vanguard of change are the people who take the most abuse,” Smothers said.

Bruce was convicted of a misdemeanor, giving an obscene performance, and sentenced to four months, which he didn’t serve.

Acting as his own attorney, the legendary comic botched his appeal attempt before dying in 1966 of a drug overdose. Four years later, the Court of Appeals reversed the conviction of co-defendant and club owner Howard Solomon.

Pataki said, “I hope this pardon serves as a reminder of the precious freedoms we are fighting to preserve as we continue to wage the war on terror.”