A pair of American and Russian astronauts pulled off a complex and potentially risky mission yesterday to fix a faulty gyroscope aboard the international space station, finishing the job they had been forced to abandon abruptly last week.

This time the two crewmen accomplished the spacewalk -- which lasted five hours and 40 minutes -- with aplomb, finishing so far ahead of schedule that they got a head start on tasks for future spacewalks.

Ground controllers tested the gyroscope as soon as the astronauts had completed the repair. While the crewmen admired the view from space, officials confirmed that the gyroscope was working properly. It may take another day or so before the device is fully functional.

A spacesuit malfunction forced the astronauts to halt the first repair attempt last Thursday.

The operation required American Edward "Mike" Fincke and Russian Gennady Padalka to emerge from the Russian section of the space station to perform the repair on the American side.

The mission began earlier than scheduled with the space station still in darkness, about 240 miles above Africa.

"I think I am in a good position," Fincke said shortly after the astronauts had eclipsed the length of the 14-minute attempt they made last week. As Russian ground controllers led the astronauts through the initial procedure, Padalka said, "Everything is in order."

The crewmen began by extending a boom. Fincke tethered the boom to a handrail and the Russian then pulled himself hand over hand out to his companion.

The repair required two 45-minute traverses between the Russian and American sides of the space station, including periods where the men could lose radio contact. Ground controllers had devised a system of hand signals and designated a rendezvous point where the astronauts could regain contact. As the mission progressed, however, radio communication remained strong.

As they clambered hand over hand on the outside of the space station, the crewmen were warned to watch out for delicate cables. Over and over again, ground controllers asked them to move methodically, checking and rechecking every step of the procedure -- and making sure they were securely attached to safety tethers.

"The tethers can get tricky, so take your time," American controllers told Fincke about an hour into the spacewalk -- shortly before the crewmen saw the sun setting as they flew over the southern tip of South America.

At 6:37 p.m. Eastern time, the two men started to traverse separate paths to their work stations.

About 11/2 hours after the spacewalk began, they began removing bolts to get to the faulty circuit breaker. Ground controllers gave precise instructions on how many turns were needed for each bolt, reminding the astronauts to stow the bolts carefully.

"Gently try to open the door and see what the situation is," a ground controller in Houston told the men after the first set of bolts was removed.

"The door is starting to slide open -- we're able to open it six to eight inches," Fincke said.

"Stop, stop, stop -- continue," said Padalka at one point.

"We've got plenty of time," ground controllers reminded them.

"We've got it open about 12 inches," Fincke reported.

Moments later, the last of the 12 bolts was released. With the blue curving horizon of Earth in the background, the crewmen struggled for a while to open an access door, but finally succeeded at 7:35 p.m.

A little more than 21/2 hours after the spacewalk began at 5:19 p.m., Fincke and Padalka replaced the circuit breaker that had disabled the gyroscope. After the complex effort to get the crewmen in place, the actual repair was accomplished with anticlimactic speed. The only real problem the crew encountered was in getting the panel door open after they removed the bolts, and in replacing the door after making the repair.

The orbiting laboratory was built by more than a dozen countries, starting in 1998. Since the Columbia disaster last year and the grounding of the space shuttle fleet, it has been operating with a two-person crew and limited supplies.

The space-age electrical fix on the problem-plagued space station followed the failure of two gyroscopes, which have rapidly spinning wheels that keep the station properly oriented. The station can function with its two remaining gyroscopes, but should a third fail, a repair at that point would entail considerably greater risk.

Only two crewmen were aboard the station, instead of the usual three, which meant that no one was inside to deal with a potential emergency.

Last week's spacewalk was aborted after Fincke's oxygen supply began to deplete too quickly. Russian controllers immediately ordered the men back into the hatch. Another spacewalk was canceled in February after a cooling problem with a Russian spacesuit.