Five weeks ago Ana Brooks started having contractions. She was in only the 27th week of her pregnancy, and doctors knew the triplets she was carrying would stand little chance of survival if they were born that soon.

Faced with a life-and-death decision, doctors at Baltimore's City Hospitals injected the Lanham, Md., woman with Ritodrine, a birth-delaying drug untested in cases of multiple gestation. They hoped to prevent birth until the fetuses, which weighed as little as two pounds, had matured.

Tuesday morning their strategy provided happy results. Brooks gave birth to three healthy boys, and according to her doctors, the successful use of Ritodrine could prove of major importance for women expecting often-dangerous multiple births.

"Prematurity is the cause of two-thirds of all baby deaths," says Dr. Frank J. Bottiglieri of Johns Hopkins University Hospital, who treated Brooks and delivered her babies. Multiple births tend to be premature because the uterus becomes so enlarged that it contracts prematurely.

The successful births in Baltimore "give a lot of hope to a lot of women out there," says Bottiglieri. "We have shown for the first time that Ritodrine works in cases of multiple gestation."

Bottiglieri notes that the womb is a better place for a 27-week fetus than a hospital's intensive-care nursery. "And if you want to be cost effective, it's better, too," he adds. "It costs $800 a day per baby in intensive care."

None of the three Brooks babies is on a respirator, and the largest, 5 1/2 pounds, is already eating. Brooks is expected to be released within a week, and the babies should follow her about a week later.

While Bottigleri writes up his findings for the medical journals, Brooks will be celebrating the end of a long and painful ordeal that began with her first contractions May 19. She rushed to Washington Adventist Hospital, where doctors realized they couldn't cope with the problem.

"The doctor at the hospital where I went first was scared," Brooks recalled yesterday. "Then I was scared, too."

Neither George Washington nor Georgetown hospitals had room for Brooks, so arrangements were made to airlift her to Baltimore. But the helicopter was forced to return almost immediately to Washington Adventist because of stormy weather. Brooks was then transferred to an ambulance and driven to Baltimore.

After the decision was made to give Ritodrine to Brooks, she was kept in City Hospitals for the next five weeks. Brooks -- who is separated from her husband and whose friends in Lanham were unable to visit frequently -- became so lonely and depressed she "closed the curtains around my bed."

The contractions began again twice, and each time doctors put Brooks on intravenous Ritodrine.

Brooks was so anxious by the time contractions began for the third time at the beginning of June that she refused to take the medication.

"I kept saying, 'I want to have these babies,'" she said yesterday. The hospital called in Bottiglieri at 2 a.m., and he tried to convince Brooks that the longer the births were delayed, the healthier the babies would be.

Bottiglieri showed her a sonogram (a kind of X-ray) of the three fetuses, and from their outlines Brooks was able to see that they had grown. That convinced her to take the Ritodrine.

When she started contractions Tuesday morning, Bottiglieri decided they had no choice and performed a cesarean section.

"Anna was scared," Bottiglieri said. "She wanted those babies so terribly badly and had waited for so long that the fact that they were finally here scared her."

"The whole thing moved very rapidly," Bottiglieri said. "There is no way of watching and monitoring three babies at once, so once things start, you have to try to get them out as soon as possible." The babies were delivered in the space of three minutes.

Brooks, who has three other children, will return to the home of some friends when she gets out of hospital and will start looking for an apartment of her own.

She has named her three new sons Byron, Samuel and Wesley, but says she's worried about bringing the babies home: "I don't know how to tell them apart."