Two spacewalking astronauts finished folding up a stubborn, accordion-like solar panel that was stuck on the international space station, resolving the only complication in space shuttle Discovery's otherwise smooth mission.

• Click here to visit FOXNews.com's Space Center.

Shuttle astronauts Robert Curbeam and Christer Fuglesang, a Swede from the European Space Agency, managed to get the last section of the 115-foot (34.5-meter) array folded into a box about five hours into the spacewalk. It was the fourth venture outside for Discovery's astronauts during their visit to the orbiting outpost.

Workers in Mission Control applauded when the final section fell into the box. But Curbeam radioed back that a wire was still loose. About 30 minutes later, he managed to get it rolled up and the box latched.

"Great job by everybody up there and everyone on the ground here," Mission Control said.

The pair used a scraper to try to get the array unstuck, shook the panel and used pliers to tighten the wire that folds it up. It was a stop-and-go process with astronauts inside the space station repeatedly sending remote-controlled commands to fold up the array.

The addition of Monday's impromptu spacewalk forced NASA to delay Discovery's return home by a day to Friday.

The electricity-generating array became stuck Wednesday in the halfway-retracted position as it was being folded up by remote control. After repeated efforts to get it to retract — including attempts to shake it loose by having an astronaut exercise vigorously aboard the space station — NASA decided to send two cosmic mechanics out to fix it.

It was Curbeam's fourth spacewalk of the mission, the most by any astronaut during a single shuttle flight.

The array was part of the space station's temporary power source. The space agency had to retract it to make room for a newly installed array that will be part of the space station's permanent power source.

The array posed no danger in the half-retracted position. But NASA wanted to take advantage of the extra hands on deck to get it taken care of now, instead of asking the space station crew members to make a spacewalk.

Also, another array on the station is scheduled to be similarly retracted on a future mission, so NASA figured it would use this opportunity to learn how to troubleshoot the problem.

In a worst-case scenario, NASA could simply jettison the array.

Grommets — metal eyelets through which a guidewire runs — were the source of the problem. Bunches of the grommets stuck together.

The Discovery crew awoke to the Beach Boys hit "Good Vibrations."

"We sort of thought that the wake-up music this morning summed up our hopes for the day," Mission Control said.

The astronauts, scheduled to land on Friday after a 13-day mission, have completed their main tasks: rewiring the station; installing a 2-ton (1.8-metric-ton), $11 million (euro8.4 million) addition to the orbiting space lab; and replacing space station crew member Thomas Reiter of Germany with American astronaut Sunita Williams, who will spend the next six months in orbit.

• Click here to visit FOXNews.com's Space Center.