In a five-hour display of skill and endurance, two American astronauts today overcame one setback after another to salvage a stray satellite and wrestle it into the cargo bay of the space shuttle Discovery.

Astronauts Joseph P. Allen and Dale A. Gardner first used their arms and hands to push the satellite Palapa out of orbit and into Discovery's cargo bay, then used tools and brute force to fasten it to the spaceliner's deck.

After today's ordeal -- almost certainly the most demanding spacewalk in history -- Allen and Gardner will rest a day and then try on Wednesday to retrieve a second errant satellite.

"I don't know how it looked to you guys down on the ground but all that manhandling you saw was not a piece of cake," Gardner said when he and Allen were back inside the cabin and had their spacesuits off. "We did it, and we could do it again, but we don't think it's the way to go."

To the people who built the satellite and the underwriters who insured it against loss, the rescue of the $35 million satellite was remarkable.

"We're ecstatic," said David J. Braverman, associate manager of commercial systems for Hughes Aircraft Corp., which built the Palapa satellite for Indonesia. "We're absolutely astounded by what those two guys did."

"Their job was remarkable by any standard," said Steven Merrett, chairman of Merrett Syndicates Ltd., the British firm that led a consortium of underwriters. "These heroic American astronauts provided the highest drama today I can think of."

What made a demanding assignment even more so was the early inability of the two astronauts to fasten a metal A-frame to one end of the satellite because of a piece of metal protruding one-eighth inch too far. That failure gave Discovery's mechanical arm nothing to grab onto to steady the satellite while the astronauts attached a second A-frame that would secure it in the cargo bay.

But the day had begun as if the first space salvage operation ever tried might be little more than a cakewalk.

Early in the morning, Discovery commander Frederick H. Hauck and pilot David M. Walker flew the spaceliner to within 35 feet of the slowly spinning satellite.

"Oh, my goodness, look at that," Allen said. Exclaimed Gardner: "Holy smoke, look at that satellite."

Just after 8:15 a.m. EST, Allen and Gardner, wearing their spacesuits, moved out into the cargo bay to begin the salvage operation. Putting on a jet-powered backpack, Allen flew to the satellite. Around his waist he wore a truss holding a six-foot-long probe called a "stinger," designed to be inserted into Palapa's bell-shaped engine nozzle so he could clamp himself to the satellite. He accomplished it on the first try.

Firing the jets on his backpack, Allen easily halted the satellite's rotation. Then, pushing the satellite ahead of him like a scuba diver pushes an underwater sled, Allen moved the huge cylinder slowly toward Discovery and a waiting Gardner, who was held fast to the cargo bay deck in a pair of foot restraints.

Allen detached the stinger from the satellite and stowed it and his backpack in the cargo bay, while Gardner removed Palapa's 10-foot-tall antenna mast and stowed it.

Then things began to break down.

The idea was to attach A-frames to each end of the satellite, one for use in maneuvering it and one to secure it in the cargo bay for the return to Earth. Gardner was to attach the first A-frame while Allen steadied the satellite by hand with assistance from astronaut Anna L. Fisher, inside Discovery, using the shuttle's mechanical arm.

After the first A-frame was attached, the astronauts would spin the satellite 180 degrees so Gardner could attach the second A-frame. With that done, they would ease the satellite into the cargo bay and bolt down the second A-frame.

But when Gardner tried to clamp on the first A-frame, he kept bumping its crossbar onto a piece of metal -- a "feed horn" used for signal transmission -- that was sticking out from the satellite one-eighth inch too far.

"It's not a piece I can remove," Gardner said after trying numerous times to clamp onto the satellite. "I tried twisting it, everything I could think of. Close doesn't count."

"If that crossbar had been set back an eighth of an inch or that feed horn had been set back an eighth of an inch," Hughes Aircraft's Braverman said, "it would have cleared."

Braverman explained that the "feed horn must have been tested and moved after the satellite had been built and just before it was shipped to Cape Canaveral and launched on a space shuttle mission last February."

"It was an oversight," Braverman admitted. "I'm sure the new dimensions of that piece of metal were written down someplace but they weren't written down on the engineering drawings that NASA used to build that A-frame."

Once it was clear that there was no way to clamp the first A-frame to the satellite, Allen and Gardner turned to their backup plan: nothing more than the use of strength and endurance to get the satellite into the cargo bay without help from the mechanical arm.

Looking like space-suited dock workers, Allen and Gardner turned the drum-shaped, nine-foot-tall satellite every way possible in trying to maneuver it into position.

At one end, the 130-pound Allen steadied the 1,285-pound satellite with outstretched arms for almost 90 minutes. At the other end was Gardner, wrestling with wrenches with one hand and trying to stabilize the satellite with the other while he attached the second and critical A-frame.

At one point the astronauts had to put on "thermal mittens" because the satellite's metal skin was too hot to touch in the sunlight. At another, a wrench Gardner wanted to use was so frozen from the cold in space he could not remove it from its stowed position.

Allen held the satellite with outstretched arms for so long a stretch that he began to resemble a statue. From Mission Control, astronaut Jerry Ross told Allen: "Bonnie Allen's wife says make sure there are no pigeons on your shoulders."

So concerned was commander Hauck that he asked Allen: "Are you comfortable, Joe?" Allen answered: "Not pause very."

As difficult as it obviously was, Allen and Gardner slowly but surely began the job of getting the second A-frame fastened to the satellite. Gardner told Allen when and how to roll the satellite while he used a torque wrench to tighten down nine bolts to hold the A-frame to the satellite.

"Easy now -- we want a good used car here," Walker called from the cabin as Gardner tightened the last of the nine bolts.

Replied Gardner: "We're just about there. Anna, we apologize for taking all that fun work from you."

Gardner was referring to astronaut Fisher's inability to help them with the robot arm.

Then Gardner's torque wrench broke just as he tightened the last fastening. "Boy, was that good timing," said Hauck from inside the cockpit. "Very fortunate."

Looking a little bit like piano movers, Allen and Gardner moved the satellite down to the floor of Discovery and placed three large bolts around the A-frame. From inside the cockpit Walker pushed the button that drove the three bolts home, securing the satellite inside the bay.

"I think those guys did a superb job under the circumstances," Braverman told reporters. "It just reaffirms to me what men can do in space."