Gloria Swanson, the famed actress of the silent film era who held an enduring place in Hollywood history and American legend as the embodiment of beauty and glamor, both on screen and off, died yesterday in New York City. She was 84.

Known as one of the first actresses to make, and to spend, $1 million, Miss Swanson thrilled and delighted movie audiences in the 1920s in roles ranging from sultry vamps to sophisticated society women. Off-screen, she won the awe often reserved for royalty.

A return to the screen in 1950 in the much-acclaimed "Sunset Boulevard," in which she played a faded idol of the silent screen seeking desperately to make a comeback, won her millions of new admirers and rekindled the enthusiasm of old ones, who called the performance one of her best.

Miss Swanson, who had been married six times and was a great-great-grandmother, had entered New York Hospital about a week before her birthday, March 27. At her family's request, the hospital did not disclose the nature of her illness, but a friend said last week that Miss Swanson had suffered a heart attack.

She attracted some notoriety in 1980 with the publication of an autobiography, "Swanson on Swanson," in which she said she had an affair in the 1920s with Joseph Kennedy Sr., the father of President John Kennedy.

In a letter to The Washington Post, Eunice Kennedy Shriver, the late president's sister, called the account "warmed-over, 50-year old gossip" and a "shopworn story of an alleged affair."

Miss Swanson began in films as a teen-ager and went on to appear in more than 60 movies as well as in stage productions and on television. She was born Josephine May Swenson in 1899 in Chicago, where her father, Joseph Swenson, was attached to the Army.

While attending school on or near various Army posts in her childhood, she showed an inclination toward dramatics and singing. The end of her formal education and the beginning of her career occurred when she was 14 and visiting an aunt in Chicago.

The aunt took her to visit the Essanay Studio, where silent films were being made. Someone thought her photogenic and she got work that day as an extra. Although by some accounts she was a timid child without early dreams of cinema stardom, she continued at the studio, winning more-substantial parts.

Within a short time, she was in Hollywood, where she worked for the Keystone studios, noted for their comedies.

In comedy, she said, "I was funny because I didn't try to be funny. The more serious I got, the funnier the scene became."

By the time she began working for the well-known director Mack Sennett, she was using the name Gloria Swanson, and in time made the transition to dramatic roles.

In 1918 she joined Cecil B. de Mille, who showed her on screen in ornate and luxurious surroundings with opulent costumes that embellished the seductiveness of her glance, and intensified the glamorous aura for which she began to become known.

The six films that Miss Swanson made for de Mille helped her become one of Hollywood's biggest box-office attractions.

Later at Paramount studios, Miss Swanson appeared in "Zaza," "The Hummingbird" and "Manhandled." She went to France to make "Madame Sans-Gene," about Napoleon's washerwoman.

While abroad, she married her third husband, the Marquis de la Falaise de la Coudray, making her the first Hollywood star to marry a titled spouse, and enhancing the concept that screen stars were themselves a breed of royalty.

In time, Miss Swanson was identified with many other "firsts." She was said to be the first famous film actress to have a child, to adopt a baby, to become a grandmother, to make a film in France and to make a talking picture in England.

With Miss Swanson enjoying the peak of popular adulation, Paramount offered a long-term contract at $18,000 a week. She shunned it, instead forming her own production company, which numbered Joseph Kennedy among its backers.

The company made several films before she dissolved it in the 1930s, including "The Trespasser," the first film to record her speaking and singing voice. She made the transition to the talkies with ease.

In 1948, in the infancy of television, she produced and played in "The Gloria Swanson Hour," in which she talked with guests in a set with a design based on her own Fifth Avenue apartment.

In "Sunset Boulevard" in 1950, audiences watched breathless and transfixed as Miss Swanson, playing Norma Desmond, grew increasingly frantic about her young lover and hoped-for screen comeback. Finally, hopes shattered, her dreams, like her Hollywood mansion, decayed around her, Norma descends into madness and murder.

Although Miss Swanson, like Norma, had been one of the great stars of the silent cinema, the parallels ended there, she was quick to point out.

"I'm not Norma Desmond," she once told an interviewer. "I'm not a recluse and I don't live in the past. I travel so much that when I wake up in the morning I sometimes don't know which side of the bed to get out of. I have an insatiable curiosity about everything, and I like young people."

"Sunset Boulevard" represented a spectacular comeback, but few other film roles followed. Most of the offers were for repetitions of the 1950 success and she said she feared to parody her triumph.

In 1974, as if to underscore her asserted interest in the new and different, she played a mean Queen Bee in a made-for-television film called "Killer Bees." Later that year she played herself in "Airport 1975."

She also became a fervent exponent of the virtues of health foods as a means of staving off disease.

Entertainer Bob Hope called Miss Swanson "a wonderfully vibrant lady whose name was synonymous with Hollywood. She had an aura of glamor that few stars before or since have displayed."

Of Hollywood in the fabled 1920s, Miss Swanson said, "We lived like kings and queens in those days--and why not? We were in love with life. We were making more money than we ever dreamed existed and there was no reason to believe it would ever stop."