MIDLAND, TEX., OCT. 17 -- Surgeons operated today to relieve the swelling of Jessica McClure's right foot, which was severely bruised when the 18-month-old girl spent nearly 2 1/2 days stuck in an abandoned well shaft 22 feet below ground.

The surgery, known as a fasciotomy, was an attempt by doctors to save Jessica's foot, which they fear might have to be amputated.

"We are cautiously optimistic about the skin and the muscles that are involved. We still will not be able to tell for a number of days and possibly a week whether we are going to be able to salvage the foot," said Dr. Shelton Viney, general and vascular surgeon at Midland Memorial Hospital.

Viney said Jessica was not in any pain and did not require narcotics all night. "She's a real fighter," he said.

Jessica was rescued Friday night from the abandoned well in her aunt's back yard as much of the nation watched on television.

"I'm just glad she's safe and and we got her back. I am so happy we've got her back. The whole world has her back," Jessica's mother, Reba McClure, 17, said at a news conference today.

Although Jessica is listed in serious but stable condition, she was able to spend some time in her mother's lap this afternoon, Megan Pause, a hospital spokeswoman said. She added that some color and warmth had returned to Jessica's foot, indicating improved circulation.

The pediatric waiting area at the hospital was filled with balloons and cards for Jessica and 300 stuffed toys are expected to be delivered to her.

The White House announced that President Reagan may call Jessica's mother and father, Chip, 18. Vice President Bush, who once lived in Midland, announced plans to visit with Jessica and her parents at the hospital Sunday morning.

The toddler was listed in serious but stable condition when the surgery began. The fasciotomy involved making small slits in membranes called fascia, which enclose muscles. When muscles swell, as Jessica's have because of rehydration since her rescue from the well, the fascia resist stretching and the muscles constrict blood flow, causing a tourniquet effect, Viney said.

Jessica also was treated with pressurized oxygen in a hyperbaric chamber, which speeds healing of tissue.

Plastic surgeon Terry Tubb examined Jessica's forehead, where he said she had lost skin about the size of a silver dollar above her eyebrows. He said doctors would work to slowly replace the skin to minimize scarring.

Jessica had fallen into the well's 8-inch opening Wednesday morning while playing with two other children in the back yard of an aunt's house where her mother helped run a small day-care center.

The little girl spent 58 1/2 hours in the narrow crevice without food or drink, and Friday night broke the fast doctors had imposed by gobbling an orange-flavored Popsicle.

She spent her time underground crying for her mother, singing, humming and sleeping. She also nervously pulled out "huge chunks of her hair," said Debbie Reese, her physician.

"She probably could have gone another day, but she would have been critically ill," Reese said.

Rescuers sank a shaft paralleling the well and then cut an upward-angling tunnel to Jessica, their progress slowed by the dense caliche, or hardpan, that blunted even diamond-tipped pneumatic drills.

Coated with petroleum jelly to ease her out of the hole and secured to a backboard with gauze, Jessica was hoisted to the surface by cable on paramedic Steve Rhodes' back.

She had come to rest 22 feet below the surface in a small dogleg created when the well was drilled about 20 years ago, said Dave Lilly, a U.S. Mine Safety and Health Administration investigator.

Lilly said the hard rock probably forced the drill bit to shift slightly when the 90- to 120-foot well was dug. "If the hole had been straight, she'd have fallen to the bottom," Lilly said.

The narrow well opening is now sealed with a metal cap, made by welder Willie Thames and inscribed "For Jessica 10-16-87 with love from all of us."