Salvador Dali, 84, the Spanish artist who explored the depths of the subconscious mind in his paintings with images that reflected the fantasies, dreams and hallucinations of an enigmatic and restless spirit, died of cardiac arrest and pneumonia yesterday at a hospital in his hometown of Figueras, Spain. Mr. Dali, one of the leading artistic showmen of this century, was also the most successful exponent of the school of art known as surrealism and one of the premier artists of his time. His work was often controversial, sometimes shocking but rarely dull. He was an inveterate attention-seeker, and he was called both a symbol of intellectual and emotional freedom and a madman who was more interested in money than art. His life style was often as dramatic as his art, and probably more widely publicized, as he migrated annually between New York, Paris and a castle in Spain, sporting an ermine cape and a silver-handled cane. In a career that spanned almost six decades, Mr. Dali produced approximately 2,000 serious artistic works, a relatively small number for an artist, but he also wrote and illustrated books, poems and essays, did stage designs for plays and ballets, produced commercial advertisements, wrote an autobiography and designed jewelry, furniture, glass and china. For several years before his death, his works outsold those of all other living artists, but recently the artistic community has been scandalized by charges that much of what was represented as the work of Mr. Dali was, in fact, a forgery. He was most productive as an artist from the mid-1920s through the early 1940s, when the surrealist period was at its zenith. Many of his paintings of that era were famous for their juxtaposition of unrelated objects in an environment where they did not belong, such as "The Persistence of Memory" (1931), said to be the "most celebrated surrealist canvas ever painted." That painting, now at the Museum of Modern Art in New York, is known chiefly for its limp watches draped over various objects, including a branch of a dead tree. By the late 1940s, Mr. Dali had begun to move away from surrealist art. He declared at the age of 45 that he wanted to "paint a masterpiece to save modern art from chaos," and he began to pursue an interest in religion. "The Madonna of Port Lligat" (1949), "Christ of St. John of the Cross" (1951) and "The Last Supper" (1955), which is now at the National Gallery, are among his more notable paintings of that period. It was also during the postwar era that Mr. Dali began to become involved with other media -- to the detriment of his art, in the view of some critics. He created fashion designs, wrote the scenarios and designed the decor for a half dozen ballets, went to Hollywood, where he designed the dream sequence for an Alfred Hitchcock film, "Spellbound," and worked with Walt Disney on a film called "Mysteria." As he grew older, Mr. Dali became increasingly subjected to charges that he was more interested in money and publicity than art, and his own statements and bizarre antics often provided ammunition for his critics. "I love money," he once said. "I pursue it gallantly, daringly, uninhibitedly because it allows me to do what I want, to scorn the critics, to balk at the tides, to charge like the bravest of bulls." He attracted widespread publicity with such stunts as painting a nine-foot canvas in 12 minutes using a broom, a house painter's brush and, at the end, his forehead and a shoe, both of which he immersed in a four-gallon can of paint, while a reporter kept time with a stopwatch. With his upturned waxed mustache, bulging eyes and long hair, and his often outrageous statements, bizarre antics and outlandish dress, Mr. Dali was a natural subject for media attention. He was highly publicized during the late 1930s for delivering a lecture in London dressed in a diving suit and helmet and for smashing a display window at Bonwit Teller in New York, where an exhibition of his works had been rearranged without his knowledge. He remained a favorite of the media throughout his life. Never modest or self-effacing, he claimed repeatedly that he was the greatest artist of modern times. "Every morning upon awakening, I experience a supreme pleasure: that of being Salvador Dali, and I ask myself, wonderstruck, what prodigious thing will he do today," he once said. Pablo Picasso, although 23 years older than Mr. Dali, knew him as a young man and said he had a brain that was "like an outboard motor continuously running." George Orwell thought he was a "dirty little scoundrel and as antisocial as a flea," and Joan Miro, his artistic contemporary who died in December 1983, said he had "great admiration for the beginning" of Mr. Dali's works, while omitting comment on the end of his career. In fact, several critics thought Mr. Dali's art entered a period of serious and permanent decline after World War II, but A. Reynolds Morse, a Cleveland industrialist and one of the leading American experts on Mr. Dali, contends he was, nevertheless, "our age's greatest painter." In recent years, Mr. Dali had suffered from a variety of health problems, including Parkinson's disease, malnutrition and deep depression. Since the death of his wife, Gala, in 1982, he had remained most of the time in his quarters at a restored 12th-century castle at Pubol, behind the Spanish Mediterranean coastal hills north of Barcelona. He was badly burned there in August 1984 when a short circuit in a device he used to summon his nurses caused his bedclothing to catch fire, and he had used a wheelchair since then. His business affairs, never orderly, had become mired in chaos and confusion; the art world was scandalized by forgeries of his works, and Mr. Dali himself was said to have signed thousands of blank sheets of paper for easy conversion into bogus Dali "originals." By some estimates, the forgeries of Mr. Dali's art ran into hundreds of millions of dollars. Salvador Felipe Jacinto Dali was born into a middle-class family in the town of Figueras in Upper Catalonia, Spain, on May 11, 1904, two years after the death of a brother who was also named Salvador. His father was the state notary, dictatorial and passionate yet relatively liberal-minded, and he accepted without too many reservations the fact that his only son wished to be an artist. As a child, Mr. Dali demonstrated a talent for drawing, and by the time he was 10 he had already completed two ambitious oil paintings, "Helen of Troy," and "Joseph Greeting his Bretheren." As an adolescent, he painted scenes from the Spanish coastal town of Cadaques, where he spent his summers at the vacation home his parents owned on the beach. Those paintings depicted everyday life in the old town, the church, the olive trees on the hillsides, the coves and fishermen and the peasant women. In 1921 Mr. Dali's father sent him to the San Fernando Academy of Fine Arts in Madrid, where he won several prizes. It was during this period that the young artist began to abandon the bright colors he had used in his earlier paintings in favor of more austere tones. Coming under the influence of the cubist Juan Gris, he did his first cubist paintings, using only black, white, sienna red and olive green. Mr. Dali also managed to get himself suspended from the academy for a year in 1924 on charges of inciting his fellow students to riot over the appointment of a painting professor whom he considered to be mediocre. He returned a year later but was expelled in 1926 for what the academy said was his support for revolutionary causes. Mr. Dali contended the real reason was his refusal to take an examination because he was convinced he was "infinitely more intelligent than the three professors" who were giving it. He painted in a variety of styles before 1928, when he was introduced to surrealism by fellow Spanish artist Miro on a visit to Paris. Founded in 1924 by the French poet Andre Breton, the surrealist movement advocated the "systematic exploration of the subconscious imagination," and Mr. Dali, already steeped in the writings of Sigmund Freud, soon became one of the leading surrealists. He collaborated with a friend, Luis Bunuel, in writing the scenario for "Un Chien Andalou," probably the best-known surrealist movie ever filmed, and his paintings began to reflect the surrealist ethos. In 1929 he painted "The Great Masturbator," one of his more significant paintings of the period. The main subject of that painting is a large, soft, waxlike head with pink cheeks and closed eyes with very long eyelashes. A tremendous nose is leaning on the ground, and the mouth is replaced by a decaying grasshopper crawling with ants. For the better part of the next decade, Mr. Dali's paintings were characterized by a variety of sexual and scatological images, and he had a fondness for including in them such things as grasshoppers, telephones, melting torsos, ants, keys, hair, crutches and bread, most of the time in out-of-place settings. Mr. Dali called this technique the "handmade photography of concrete irrationality" and it was based, he said, on "the associations and interpretations of delirious phenomena." By his own admission, he did not always fully understand all of his images or why he used them. He had a falling out with the surrealists, and in 1934 they expelled him from the movement, contending he had developed an unhealthy interest in money and was guilty of "vulgarization and academicism." Mr. Dali responded that the only difference between him and the surrealists was that "I am a surrealist." In 1935 Mr. Dali and his wife, Gala, were married in a civil ceremony, and although she had initially found him "impertinent, pompous and insupportable," they were to remain happily married until she died in 1982. Fourteen years older than Mr. Dali, Gala was born Helena Dimitriovnie Diakonova, the daughter of a Moscow lawyer. In 1929, she left her husband, the French poet Paul Eluard, for him. She served as a model for many of Mr. Dali's paintings over the years. With surrealism at the height of its popularity during the 1930s, Mr. Dali's paintings were shown with increasing regularity at exhibitions in New York, Paris, London and other major capitals of the world, and he visited the United States for the first time in 1934. When the Spanish Civil War broke out in 1936, he left Spain with Gala to live in France and Italy, but his paintings reflected his personal anguish over the fighting in his homeland. With the outbreak of World War II, Mr. Dali fled Europe for the United States. He lived briefly on a country estate near Fredericksburg, Va., then settled in Del Monte, Calif., where he spent most of the war years. New York's Museum of Modern Art held a large exhibition of Mr. Dali's paintings in the fall of 1941, and Mr. Dali began painting portraits of women who were prominent in society. In 1942 he published his autobiography, "The Secret Life of Salvador Dali," which drew mixed reviews. Not until 1949 did he return to Spain, to Port Lligat, a quiet cove near the fishing village of Cadaques where he had spent his summers as a youth. He had an audience with Pope Pius XII, made his peace with the Catholic Church after a long estrangement, and began doing religious art. Over the remaining decades, Port Lligat remained Mr. Dali's primary residence, and there, surrounded by admirers and hangers-on, he spent more and more time on a variety of business and commercial affairs. For several years, he did one large painting a year -- usually for a fee well into six figures -- and his business activities ranged from selling lithographs to designing shirts and bathing suits and making airline commercials. In 1974, he opened a "theatre museum" in his native village of Figueras, and it soon became the second most popular in Spain, after the Prado Museum in Madrid. Mr. Dali had no children, and he always said he never wanted any. "Great geniuses always produce mediocre children, and I do not want to go through that experience," he said. "I am only interested in inheriting myself."