Anthony Blunt, 75, Queen Elizabeth's former art adviser who was unmasked in 1979 as a former spy for the Soviet Union, died at his home here yesterday. He had a heart ailment.

Mr. Blunt had access to Buckingham Palace as the surveyor of the queen's pictures--or adviser on her art collection--for 20 years before retiring in 1972. He was named in 1979 by Prime Minister Margaret Thatcher as the so-called "fourth man" in the Kim Philby-Guy Burgess-Donald Maclean ring of highly placed British spies who passed intelligence to the Soviets during World War II.

It was Mr. Blunt who tipped off Burgess and Maclean in 1951 that British security agents were closing in to arrest them, enabling them to escape to the Soviet Union. Since then, speculation had grown about the spy who must have tipped Burgess and Maclean that the game was up, and who more than a quarter of a century later still had not been unmasked.

"The name which the honorable gentleman has given me is that of Sir Anthony Blunt," Mrs. Thatcher revealed in 1979.

"In April 1964," Mrs. Thatcher said, "Sir Anthony Blunt admitted to the security authorities that he had been recruited by and had acted as a talent spotter for Russian intelligence before the war when he was a don at Cambridge and had passed information regularly to the Russians while he was a member of the security services between 1940 and 1945.

"He made this admission after being given an undertaking that he would not be prosecuted if he confessed."

The prime minister said it was known Mr. Blunt had held Marxist views as a member of a group of brilliant Cambridge intellectuals, known as the "Apostles," but he was able to join the security service in 1940 because it "had no reason, either in 1940 or at any time during his service, to doubt his loyalty to his country."

Not until 1964, she said, did new information directly implicate him. However, it was decided it did not provide a basis for prosecution because the only evidence against him would have been his own confession. Mr. Blunt then offered to trade immunity from prosecution for what he knew about the Soviet spy network.

"Mr. Blunt then admitted," said Mrs. Thatcher, "that like his friends Burgess, Maclean and Philby, he had become an agent for Russian intelligence, had . . . regularly passed information to the Russians while he was a member of the Security Service and that, although after 1945 he was no longer in a position to supply the Russians with classified information, he used his old contacts with Russian intelligence to assist in arrangements for the defection of Burgess and Maclean."

In his confession, she went on, "Blunt provided useful information about Russian intelligence activities and about his association with Burgess, Maclean and Philby."

Mr. Blunt's espionage career began to surface publicly after the 1979 publication of a book by Andrew Boyle, which did not name Mr. Blunt but dropped enough clues about a "fourth man" that members of Parliament raised the matter in the House of Commons.

British authorities had learned of Mr. Blunt's spying from an American, Michael Straight, whom he had tried to recruit as a spy at Cambridge University in the 1930s. In a recent book Straight said that in 1963 he went to the FBI and claimed that Mr. Blunt was a spy.

Mr. Blunt was allowed to remain as the queen's art adviser until his retirement, and in recent years had lived a quiet life in his London home. But after Mrs. Thatcher's revelations in Parliament, Queen Elizabeth personally issued orders stripping him of his title as Knight Commander of the Royal Victorian Order, a knighthood he had received for his service to the art world. He also had to give up his academic honors and resign from the British Academy.

In his only interview after his past was revealed, Mr. Blunt said that he spied for the Soviets during World War II as a matter of "political conscience," now bitterly regretted.

"In the mid-1930s, it seemed to me and many of my contemporaries that the Communist Party and Russia constituted the only firm bulwark against fascism, since the Western democracies were taking an uncertain and compromising attitude towards Germany," he said.

He said he later regretted his "appalling mistake" and grew to abhor the Soviet regime.

Mr. Blunt, the son of a vicar, showed early artistic talent and was sketching at the age of 4. By 14 he was a budding art historian. He then studied at Cambridge University.

He was an authority on the drawings of Nicholas Poussin and on French art and architecture. He was for many years director of the Courtauld Institute of Art in London and served as Slade professor of fine art at Oxford.

He was a homosexual and never married. Survivors include a brother, Wilfred.