Ling-Ling the panda, whose 10-year struggle with sex and fertility often seemed to mirror the anxieties of her human contemporaries, finally produced her first baby yesterday, but it died after three hours of life.

The diminutive 4.7-ounce male cub, first of its species ever born in the United States, burst forth from its 250-pound mother at 3:18 a.m. to the astonished delight of volunteer panda watchers keeping a round-the-clock vigil at the National Zoo.

Vigorous and squealing for most of its brief life, it was licked and cradled by its mother and appeared as healthy, zoo officials said, as any of the world's handful of zoo-born panda offspring.

Between 6:30 and 7 a.m., however, the baby no longer appeared to be breathing, though Ling-Ling, the officials said, continued to show exemplary maternal behavior. She held and licked the tiny body until late in the day, her keepers reluctant to intervene.

Initial results of an autopsy conducted last night indicated that the cub died as a result of respiratory failure caused by an excessive buildup of fluid in the thoracic cavity.

There was no indication that death was caused by external injury, and the cause of the fluid buildup could not be explained immediately, a zoo spokesman said.

Dr. Christen Wemmer, the zoo's acting director, and Dr. Devra Kleiman, the zoo's acting assistant director for animal programs, said that, while it was "clearly sad that the cub was lost," the death of the firstborn is not uncommon in the animal world and often helps reinforce maternal instincts crucial to the successful rearing of subsequent offspring.

"What happened this morning has happened in many zoos with many different species. . . ," Wemmer said. "We've worked hard at the National Zoo to breed these pandas . . . . It has taken a long time and each year we've come a bit closer.

"Even though we lost the cub, we now know Ling-Ling is capable of conceiving and giving a normal live birth . . . . Hopefully next year the young will survive to maturity."

The death of the cub was merely the latest reproductive setback in pandaland, where frustration has been the rule rather than the exception for more than a decade.

Each spring since their arrival from China in 1972, Ling-Ling and her hapless mate Hsing-Hsing have been brought together to make something happen, but until last spring nothing ever did.

After years of diets, hormones, and other scientific helping hands, plus a mail-order male shipped in one year from the London Zoo, Ling-Ling mated with Hsing-Hsing last March 19 in an event so taken to heart by the nation's capital that films of it were shown on local TV.

Ling-Ling was also dosed artificially with panda sperm shipped in from London, leaving the paternity of the cub born yesterday as mysterious as the cause of its death. Kleiman said further autopsy results might identify the father.

She said she and other zoo officials left the baby with its mother after its death in case Ling-Ling gave birth to a second cub, as a Mexican panda did last year. Sedation to remove the first cub's body might have endangered the birth of a second one.

In addition, she said, they felt the longer she spent in a maternal role, the stronger her mothering urges would be next year.

The onset of Ling-Ling's labor was as uncertain as her pregnancy. Pandas are so large and their cubs so small the expectant mother normally appears unchanged. The only true pregnancy test is delivery, but since the gestation period varies from 97 to 165 days, panda watchers don't know when to expect that.

Alerted by rising levels of the female hormone progesterone in Ling-Ling's urine, which they began analyzing in June, zoo officials estimated, Kleiman said, "that we might have a birth sometime in August."

On July 11, they set up the annual "panda watch," staffed by 90 volunteers from the Friends of the National Zoo, who worked around-the-clock in three-hour shifts observing Ling-Ling.

Wednesday afternoon she began carrying bamboo to the corner of her cage and building a nest, Kleiman said, and also spent "quite a long time grating carrots and rubbing them on her body--a new behavior for her."

About 10:30 p.m. Wednesday night the volunteers observed her begin repeated licking of the genital area, followed in subsequent hours by increased restlessness and occasional groaning.

Remarkable films of the birth, taken with monitoring equipment lent by the National Geographic Society, showed Ling-Ling lying on her back, her abdomen contracting, when the six-inch white form suddenly spurted up from her birth canal with great force, across her abdomen and down her right side onto the concrete floor.

For two minutes or so it just lay there, motionless and not breathing, apparently ignored by its mother until she accidentally touched it with her enormous paw. Then it came to life, noisy and active, its small breast heaving and legs thrashing.

Ling-Ling promptly responded by picking it up in her mouth, cradling it in her mammoth arms and licking it repeatedly. From then on throughout the day, even after it was dead, she either carried her baby, licked it or kept it beside her on the floor.

Shortly after 5 p.m., when she finally wandered to the far side of her cage, zoo officials were able to remove the small body with the aid of a loop snare on a pole.

"I don't know if she missed it," said zoo spokesman Bob Hoage. "She didn't search for it. But afterward she spent a lot of time holding an apple. She may have thought it was her cub."