With only about two hours left before lift-off, NASA postponed the launch of the space shuttle Discovery Wednesday after a sensor in the external fuel tank failed a routine but potentially crucial test.

In a late-afternoon press conference to explain the problem, NASA officials said the earliest that the launch can be rescheduled is Saturday. But they said it was too early to predict whether the shuttle could be sent into orbit during a window that lasts until the end of this month, or whether the mission would have to wait until the next available time period in September, or later.

"All I can say is 'shucks,' " said Wayne Hale, deputy manager of the space shuttle program. "We came out here all ready to go today."

He said that after one of the shuttle's engine cut-off sensors failed during one of a series of countdown tests, officials quickly decided that the launch had to be postponed because of "very clear and unambiguous criteria that all four sensors must work" to create the redundancy needed for safe flight.

Hale said the failure remains "an unexplained anomaly," as were problems with two indicators during fueling tests earlier in the year.

The external fuel tank is now being drained, and officials are developing a troubleshooting plan to try to determine what went wrong with the number two liquid hydrogen sensor. Any type of work on the sensor could not begin before Thursday afternoon, said Michael Leinbach, the shuttle launch director.

The shuttle crew, which had boarded Discovery in anticipation of a scheduled afternoon launch, left the shuttle shortly after 1:30 p.m. Discovery had been scheduled to lift off at 3:51 p.m. for a flight to the international space station as part of a 13-day mission. The planned launch represented the shuttle's return to space after a 2 1/2 -year absence, reviving America's human spaceflight program even as NASA moves to retire the venerable craft.

If NASA cannot launch the shuttle by the end of July, it will have to wait until September because of the space station's position in orbit.

Officials said one of the four engine cut-off sensors malfunctioned after the external fuel tank was filled. When a signal was sent to the sensors as part of a test to simulate that the tank had run dry, "sensor number two stayed wet," said Steve Poulos, the NASA orbiter projects manager.

That meant the sensor "would not tell you when the tank was running dry," Hale said, prompting managers to abort the countdown. He said NASA has never waived its rule that all four sensors must be operational and would not do so now.

The sensors ensure that the shuttle's main engines shut down at the right time during its ascent, a critical safety issue.

Officials had already announced Wednesday morning that weather problems might delay the launch.

Forecasters, despite beautiful conditions during the morning, were worried about gathering thunderstorms, fearing that they might not clear out of a 20-mile radius by the time of the scheduled launch. Meteorologists had put the chance of scrubbing the mission because of the thunderstorms at 60 percent, up from 40 percent Tuesday and 30 percent Monday.

The shuttle needs 20 miles of clear space around the Kennedy Space Center's Launch Pad 39B, in case it has to abort and come around for an emergency landing. Forecasters said thunderstorms in the area usually occur around noon, but that sea breezes typically blow the storms inland. They were hoping the pattern would hold and that the storms would be well past the Kennedy Space Center by launch time.

In fact, that turned out to be the case, and the weather was clear at the time of the scheduled launch.

Officials dealt with an earlier potential problem that surfaced late Tuesday when workers found that a temporary plastic cover protecting one of the shuttle windows had fallen 65 feet and damaged heat-shielding tiles on the left on-orbit engine. Officials said, however, that engineers had quickly replaced the damaged panel and that it would not affect the launch.

"We're go for launch," NASA Administrator Michael D. Griffin had said Tuesday, with no other engineering problems outstanding and little left to do but "hope that the weather gods are smiling on us."

For NASA and the U.S. space program, Discovery offers the prospect of redemption after the tragic loss of Columbia -- an opportunity to restore the agency's tattered reputation, a reaffirmation of American preeminence in human spaceflight and the long-awaited opening salvo in President Bush's initiative to put humans back on the moon by 2020 and eventually send them to Mars.

For the space shuttle, built with 1970s technology and flown 113 times since 1981, Discovery's mission will serve as the acid test for new safety features and procedures put in place after sister ship Columbia disintegrated over Texas during reentry Feb. 1, 2003, killing all seven astronauts aboard and grounding the shuttle fleet.

In a statement Tuesday, families of the Columbia astronauts blessed Discovery's journey and praised NASA for "an exemplary job in defining and reducing the technical risk as much as possible," while urging the agency to remain "vigilant."

"I'm pleased that they're supportive of our efforts -- and it matters," Griffin said in a news conference. But, he cautioned, "there is no recovery from the mistakes we have made. The safety lessons that we who fly have learned are written in other people's blood."

Discovery's external fuel tank was redesigned to minimize the shedding of ice and foam insulation, like the suitcase-size chunk that breached Columbia's heat shielding during launch, dooming the orbiter.

Independent reviewers have said that NASA made great strides in solving the debris menace but that the risk has not disappeared.

NASA has also installed more than 100 new imaging devices to check the shuttle's underside for damage during launch.

"Can we be bitten by something we don't know about?" Griffin asked Tuesday. "Sure. This is a very tough business, but everything we know how to do has been done."

The mission was aimed at advancing President Bush's "Vision for Space Exploration," the moon-Mars initiative announced in 2004.

The vision's initial job is to complete construction of the international space station. Discovery and its sister ships, Atlantis and Endeavour, with the capacity to carry 65,000 pounds of cargo, are the trucks that deliver new components and spares to the space station and haul away its trash.

Plans called for Discovery to spend most of its mission at the station, where two-member crews have spent much of their time since the Columbia disaster making interim fixes to key equipment and carefully husbanding food, water and oxygen sent up to them in limited quantities by Russian resupply spacecraft.

Space station project manager William Gerstenmaier made no secret of his eagerness to have the shuttle back, "because we can't continue assembly of the station" without it, but he insisted that an aborted launch Wednesday, or even a delay until September, would not affect the station's survival.

"It's important, but does it absolutely have to happen?" he said Monday. "No. We're still stable."

No matter when Discovery launches, the shuttle's return is only a limited engagement. On Tuesday, Griffin reaffirmed the Bush administration's wish to retire the shuttle by 2010 and replace it with a new spaceship able to travel to the moon. Discovery's flight may be historic, he said, but it is also the beginning of the end.

"The space shuttle is the most magnificent piece of transportation ever developed," just like "the clipper ships were the pinnacle of the sailing art," he said. "It's time to move on."

Branigin reported from Washington.