The Pentagon's ballistic missile defense system appeared to be working perfectly until the final six seconds of a $100 million test Tuesday night, when an infrared sensor failed to guide the "kill vehicle" into an incoming missile, senior military officials said yesterday.

Flying blind through space over the Pacific Ocean at 5,000 mph, the 55-inch-long interceptor completely missed its target, a dummy nuclear warhead. It eventually burned up as it reentered the atmosphere, while the fake warhead fell harmlessly into the sea, the officials said.

Designed to protect the United States from a limited missile attack by a "rogue state" such as North Korea or an accidental launch of a few warheads by a major power such as Russia or China, the anti-missile system is said by both critics and supporters to be the most complex weapon ever built--if it is built.

A variety of radars and infrared--or heat-sensing--devices aboard satellites and widely scattered ground stations would be linked to a computer system that would detect an incoming missile, determine its trajectory and guide interceptors to a collision high above Earth, a feat engineers compare to hitting a bullet with a bullet. All of the system's major elements are still in the prototype phase.

Whether the failed test this week will prove to be a major setback, either technologically or politically, remains to be seen. President Clinton is due to decide in late summer whether to proceed with a plan to field the first battery of interceptors by 2005, at a cost of $12.7 billion. By June, the Pentagon is scheduled to advise him on the feasibility of that deadline.

As technicians and engineers flew back to Washington this afternoon from Kwajalein Atoll in the Marshall Islands, where the main test facility was located, Pentagon officials said it would take weeks to analyze what occurred.

"The good news is we have a lot of data to look at, and the bad news is we have a lot of data to look at," said a senior military official.

All of the candidates for the Republican presidential nomination favor construction of the system as soon as possible, while the Democratic contenders are more cautious. The Republican front-runner, Gov. George W. Bush of Texas, said at a New Hampshire news conference yesterday that he "would urge the president not to allow this one failure to deter what our country must do, and that is spend the research and development dollars that are necessary to perfect a system that will work."

Sen. Byron L. Dorgan (D-N.D.), who has been skeptical of the program, told the Associated Press: "Obviously this is a setback for the program. It demonstrates that the technology does not exist yet to give anybody any confidence that this is going to work."

Pentagon officials said they were pleased with preliminary data showing that several new systems performed as well or better than expected. But the officials acknowledged they will be under intense pressure to succeed on the next test, scheduled for April or May, which will be the last exercise before Clinton's decision on whether to begin building the system.

At first glance, the only malfunction during Tuesday's test involved a pair of infrared sensors that are supposed to lock on to the target and give directions to mini-thrusters that direct the kill vehicle in the last seconds before impact.

A military official who briefed reporters yesterday, but asked not to be identified by name, said data transmitted by the kill vehicle indicated an "anomaly" that prevented either of the infrared sensors from functioning properly, but so far the nature of the difficulty had not been determined.