Vladimir K. Bukovsky, a revered Soviet dissident who, after his release from the gulag, spent the second half of his life in Britain, denouncing President Vladimir V. Putin with the same fervor he had directed at the Kremlin’s Communist leaders, died on Sunday in Cambridge, England. He was 76.

His death, at Addenbrookes Hospital, was caused by heart failure, said Elizabeth Childs, the president of the Bukovsky Center, an American-based volunteer organization. He underwent heart surgery in Germany in 2015.

Mr. Bukovsky had lived mostly in Cambridge since 1976, when the Soviet authorities freed him in exchange for the jailed leader of the Chilean Communist Party. He had spend 12 years in Soviet prisons and hospitals.

Lionized by Soviet-era dissidents, Mr. Bukovsky also inspired a new generation of Kremlin critics opposed to Mr. Putin, including the activist rock band Pussy Riot. For a time he was an informal adviser to Prime Minister Margaret Thatcher of Britain and President Ronald Reagan.

Even as tributes poured in Monday from Russia and abroad, Mr. Putin’s spokesman, Dmitri S. Peskov, when asked about the death, said, “We don’t have any comment about that.”

For all his attacks on the Soviet and Russian authorities, Mr. Bukovsky also took a dim view of the European Union, which offended his commitment to increasingly libertarian views. He denounced the E.U. as a “monster” that had to be stopped and co-wrote a book, “EUSSSR,” which explored what he saw as the “Soviet roots of European integration.”

Mr. Bukovsky was best known for exposing the misuse of Soviet medicine to “treat” political dissent as a psychiatric disorder — something he knew about firsthand, having been sent to a psychiatric hospital. The practice began under Yuri V. Andropov, the K.G.B. chief who became head of the Communist Party for a little more than a year before his death at 69 in 1984.

Mr. Bukovsky’s courtroom denunciation of the K.G.B.’s hijacking of Soviet medicine to serve political persecution enraged the authorities and established his reputation as a hero to fellow dissidents.

“Bukovsky’s heroic speech to the court in defense of freedom and his five years of martyrdom in a despicable psychiatric jail will be remembered long after the torturers he defied have rotted away,” the exiled Russian novelist Vladimir Nabokov wrote in 1974.

Galina Ackerman, a Russian émigré writer and translator in Paris who worked closely with Mr. Bukovsky in Resistance International, an anti-Communist organization set up in the 1980s, described him in a phone interview on Monday as “the great thinker of the whole Soviet dissident movement — the most resolute and politically clearheaded.”

Mr. Bukovsky, she said, “had a better vision than anyone of what was needed to weaken the Soviet regime.”

Mr. Bukovsky was freed in 1976 in exchange for Chile’s release of Luis Corvalán Lepe, the head of the Chilean Communist Party at the time, with the United States acting as intermediary. Mr. Bukovsky, who was 33, had been serving a seven‐year prison sentence on charges of anti‐Soviet agitation. The exchange took place in Switzerland, and Mr. Bukovsky then flew to London.

While many exiled dissidents, many of them intellectuals, focused on writing tracts, Mr. Bukovsky lobbied politicians in Britain and the United States to stand firm against Moscow. After the Soviet invasion of Afghanistan in 1979, he pressed for the release of Soviet soldiers taken prisoner so that they could publicize the Soviet army’s brutal tactics.

His stubborn hostility to Soviet power led him to misjudge the Soviet leader Mikhail S. Gorbachev, and he initially dismissed as a ruse Mr. Gorbachev’s liberalizing policies that led to the collapse of the Soviet Union in 1991.

But it also made him deeply aware of the tenacity of anti-democratic forces in Russia, and long before Mr. Putin took power on New Year’s Eve 1999, Mr. Bukovsky had warned that what seemed to be a new dawn of democracy in Russia would not last long. “His skepticism put him far ahead of everyone else,” Ms. Ackerman said.

A believer in the importance of practical, even if doomed, political action, he tried to compete in Russia’s 2008 presidential elections, holding rallies in Moscow and St. Petersburg. The electoral commission barred him from running against Mr. Putin’s handpicked candidate, Dmitri A. Medvedev, who won easily.

Gravely ill but still chain smoking, Mr. Bukovsky spent his last years in Cambridge trying salvage his reputation after he was criminally charged in Britain over pornographic images of children found on his computer.

He pleaded not guilty, and insisted to The New York Times in 2016 that the images had been planted, probably as part of a dirty tricks operation by Russia. But a British computer expert who testified at his trial in December that year said there was no evidence of tampering, and that Mr. Bukovsky had apparently downloaded the images himself.

The trial, at the Cambridge Crown Court, was suspended soon after it started when Mr. Bukovsky was taken to a hospital with bronchial pneumonia. A full hearing of the evidence against him never took place. The trial was scheduled to resume in February 2018 but the judge, citing Mr. Bukovsky’s “serious illnesses of the heart, lungs, liver and kidneys,” ordered the case halted.

Whatever the truth of the prosecution’s allegations, they did little to dent his standing as a giant of the dissident movement in the Soviet Union and later Russia, which he visited periodically until the Russian authorities, maintaining that they could not confirm his nationality, declined to renew his passport.

Vladimir Konstantinovich Bukovsky was born on Dec. 30, 1942, in the southern Urals region now known as Bashkortistan, where his parents, both journalists and loyal Communists, had settled after being evacuated from Moscow during World War II. The family later moved back to the capital. There, in 1953, the death of Stalin stirred the young Mr. Bukovsky’s first doubts about the Soviet system; he had been taught that Stalin was immortal.

As a student in the 1950s during the post-Stalinist period known as “the thaw” under Nikita S. Khrushchev, Mr. Bukovsky took part in public readings of previously banned poetry and started an irreverent literary magazine. After winning entry to Moscow University, Russia’s most prestigious academic institution, to study biology, he caused outrage by describing the Soviet Union as a doomed “illegal society.” He was promptly expelled. (He completed his biology studies decades later at Cambridge University.)

He was arrested for the first time in 1963 and detained for a time at Lefortovo, a notorious czarist-era jail in Moscow. Doctors at the infamous Serbsky Institut of Forensic Psychiatry soon pronounced that he was suffering from mental illness. Declared to be too ill to stand trial, he was sent to the Leningrad Special Mental Hospital for treatment. The move delighted him, he later wrote, because the hospital was “by all accounts a better place than a concentration camp.”

A solitary man who never married and whose most trusted companion in Britain was his cat, Mr. Bukovsky acknowledged in his autobiography that his ordeal in the Soviet Union had warped his previously sociable nature and made him suspicious of other people. Too many whom he had trusted, he recalled, later testified against him.

After being imprisoned for a fourth time, he wrote, “I realized that there is no greater disappointment than the life one experiences after leaving prison.” He explained what he meant: “When you meet someone for the first time, you inevitably view them as a future witness in your future trial.”