CAPE CANAVERAL, OCT. 6 -- The shuttle Discovery today ended the agony of more than five months without a launch for the manned space program. The shuttle crew later dispatched the Ulysses spacecraft on a $750 million, five-year mission to chart unexplored realms of the sun.

Flanked by the rising sun and the setting harvest moon, Discovery lifted skyward at 7:47 a.m. after being delayed for 12 minutes by minor disruptions in the countdown.

At about 1:50 p.m., the 814-pound nuclear-powered robot Ulysses, named after the Greek hero of another long voyage, was released from Discovery's cargo bay.

An hour later, a unique three-stage solid-fuel booster system began a series of firings that kicked the European-built Ulysses up to the greatest velocity ever required by an interplanetary probe escaping from Earth orbit -- 34,130 mph.

This was required by Ulysses' treacherous and unusual travel route, which is to twist around Jupiter and swoop down to loop around the poles of the sun for an unprecedented study of what scientists call the "third dimension" of the solar domain. "The team worked hard for this. They got their reward -- finally," said launch director Robert Sieck after the spectacular liftoff from Kennedy Space Center.

Asked whether the launch is enough to restore the public's confidence in the program, he said, "It's a little discouraging that they lost the faith in the first place. . . . You should keep the faith."

Though the National Aeronautics and Space Administration is still wrestling with a snarl of problems, the successful launch was a balm. The agency had been unable to launch a shuttle since April, when Discovery deployed the Hubble Space Telescope. That success was marred by the revelation in June that the $1.5 billion telescope's mirror had been manufactured to the wrong prescription.

Discovery's sister ship Columbia has failed in four launch attempts, three of them foiled by hydrogen leaks, the source of which continues to elude investigators.

The shuttle Atlantis also sprang a hydrogen leak before its last launch attempt, but that one has been found and repaired.

On Thursday, another calamity befell the program, leaving officials here incredulous. Veteran Lockheed employees processing the Atlantis left a nine-foot-long, bright yellow metal beam weighing 70 pounds loose inside Atlantis's aft engine compartment, a jungle of critical plumbing for the orbiter's main propulsion system.

When 100-ton Atlantis was hoisted from the horizontal to vertical position to be mated with its giant external fuel tank Thursday, technicians heard the beam "banging" and "thudding" around inside. The damage is being assessed, but there is no apparent reason to delay the Nov. 7 launch date for Atlantis's secret military mission, Sieck said.

Shortly after today's launch, the five-man shuttle crew commander, Richard N. Richards, told ground controllers, "There are a lot of smiling faces up here." And as the spacecraft was pushed out of its cradle later, he relayed the long-awaited news that "Ulysses is on its way!"

The scientists watching the launch with their families "jumped, clapped . . . and fell into each other's arms and congratulated each other," said Peter Wenzel, project scientist for the European Space Agency, which is managing the project jointly with NASA. "It was really a happy moment."

A 500 million-mile dash to Jupiter is the first leg of the journey of this Ulysses -- the Latin name of the Greek hero Odysseus, source of the English word for a protracted voyage, odyssey. When it reaches Jupiter in Feburary 1992, Ulysses is to hit a precise point where the giant planet's immense gravity can bend the craft's path down and out of the flat track around the sun's equator on which the planets -- and most planetary spacecraft -- run.

The spinning craft is to dive beneath the circling planets and loop back toward the star that supplies Earth's light and warmth, drives its weather and makes life possible. If all goes well, the craft will pass under the sun's south pole in May 1994.

There, solar gravity is to draw the craft up the face of the sun to arc over its north pole in June 1995.

The closest Ulysses will come to the sun is about 120 million miles, or 27 million miles farther away than Earth. Its value is in its new vantage point.

Until now, scientists have been able to study the sun only from the "side." By focusing on the polar regions, Ulysses is expected literally to reveal something new under the sun -- and over it.

The international Ulysses team, based at California's Jet Propulsion Laboratory, plans to study the Earth's interaction with solar wind, the million-mph plasma that streams from the sun's corona; the sun's corkscrewing magnetic field; and other features of the solar sphere of influence.

The sun "controls the environment of Earth -- the summers, the winters, the horrible humidity. . . . We still don't know how the sun's magnetic field works," said Derek Eaton, the European Space Agency's manager for the project. He and others have spent 15 years working on the project. "This has been a nervous time."

Formal work on the mission began in 1978, with ESA and NASA each planning to contribute a spacecraft. But budget problems in 1984 prompted the United States to cancel its craft and postpone launch of the ESA probe. In 1986, the Challenger accident forced another delay.

NASA, which contributed about $170 million of the mission's cost, had made the launch its top priority this time.

Discovery is expected to land at Edwards Air Force Base in California about 10 a.m. EDT Wednesday.

The launch of Discovery was not affected by the budget crisis that prompted President Bush to close down most of the federal government at midnight Friday, because the NASA workers are considered essential employees.

In addition to Richards, 44, the Discovery crew consists of copilot Robert Cabana, 41, and mission specialists William Shepherd, 41, Bruce Melnick, 40, and Thomas Akers, 39.