Nasa will go ahead with the first space shuttle mission since the 2003 Columbia disaster after fixing damage to a heat-resistant tile on the shuttle Discovery.
"The issue has been resolved. Launch is a go," said Nasa spokesman Mike Rein.
The tile was damaged when a window covering fell off Discovery as the spacecraft sat on the launchpad at Cape Canaveral in Florida as the clock was counting down to Wednesday's scheduled launch at 3.51pm (1951 GMT).
The damage caused by falling debris rang alarm bells
The damage to the space shuttle was rapidly fixed and will not cause any delays, Nasa said later on Tuesday, on the eve of the planned launch.
Discovery is due to lift off on Wednesday at 3.51pm (1921 GMT) from Cape Canaveral in Florida.
Nasa officials learned around 5pm local time that the window cover had struck the tile.
The discovery came just hours after Nasa's administrator, Michael Griffin, had said all issues except possible bad weather had been resolved and Discovery was ready for launch, the first shuttle flight since the 2003 Columbia accident.
"Everything is at rest today. Yesterday we were working a couple of ... issues and those were amply put to bed, so we're in good shape," Griffin said, adding that he hoped "the weather gods are kind for tomorrow".
"Can there be something that we don't know about that can bite us? Yeah, this is a tough business, it's a very tough business but everything that we know about has been covered."
"Can there be something that we don't know about that can bite us? Yeah, this is a tough business"
Nasa has not flown a shuttle mission since Columbia disintegrated over Texas on 1 February 2003. Its wing had been breached on liftoff 16 days earlier by falling foam and superheated gases rushed into the gap as the shuttle re-entered Earth's atmosphere.
All seven crew died. Discovery's mission will test improvements made to the shuttle to reduce falling debris at liftoff and experimental procedures for repairing damaged heat-resistant tiles.
The shuttle, under the command of veteran astronaut Eileen Collins, will also deliver much-needed supplies and equipment to the International Space Station. The station's construction - a 16 country project - has been on hold since the remaining three-shuttle fleet was grounded.
Nasa weather forecasters said the outlook for launch was good, but they increased the risk of thunderstorms.
"For our launch forecast, we did get a little more pessimistic on this today," weather officer Kathy Winters said as the countdown clock ticked towards the scheduled liftoff.
"There's a 40% chance of weather prohibiting launch," she told a briefing.
Any thunderstorm must be at least 20 nautical miles (37km) from the shuttle to allow a launch. A network of 112 cameras set up to monitor Discovery's surface as it soars will need clear skies to get good images.
The families of the seven astronauts killed in Columbia's fatal break-up offered their support.
Eileen Collins is the first woman
to lead a space mission
"We have had two and a half years to reflect daily on the loss of our loved ones as the shuttle Columbia broke apart over Texas on 1 Febuary 2003," the families said in a statement.
"We have every confidence that the sacrifice of our loved ones and those that preceded them will be realised for the benefit of mankind. Godspeed Discovery."
If Discovery's launch is delayed, Nasa can attempt it twice more before having to break for a few days to refuel the craft's onboard power generators.
The current launch window runs from 13 July through 31 July. The next one opens on 9 September. Griffin said the launch marked a milestone in US efforts to return to human space flight, but cautioned that space remained a dangerous realm.
"There is no recovery from mistakes we've made, whether it goes back to the Apollo fire, the loss of Challenger or the loss of Columbia," he said.
"Going back even further through 100 years of aviation, the safety lessons that we who fly have learned are written in other people's blood. The minute we say we're good enough we start getting bad again."