A space mission that endangered two cosmonauts was hastily organized for "pure propaganda" reasons and the crewmen were lucky to escape with their lives, according to an American expert on the Soviet space program.

James Oberg said Soyuz TM-5, with an Afghan crewman aboard, was rushed into space a year ahead of schedule to assure that it flew before Soviet troops completed withdrawal from Afghanistan."They asked for this trouble by throwing this mission together for pure propaganda," said Oberg, a space engineer and author of several books on the Soviet space program.

The craft landed safely Wednesday after a tense 24 hours in which malfunctions threatened to leave the cosmonauts marooned in orbit.

In a telephone interview, Oberg said he believes the cosmonauts "were seconds away from death" when a de-orbit rocket engine shut down prematurely left the Soyuz TM-5 in an orbit 155 miles above the Earth. Had the rocket fired for only a minute longer, he said, the craft could have fallen through the atmosphere and burned.

Nicholas Johnson, another U.S. space expert, agreed that the Soyuz mission was organized quickly, but he doubts the rush was related to the malfunction.

"It (the mission) was accelerated and there is every reason to believe it was politically motivated," said Johnson, who works for Teledyne Brown engineering in Colorado Springs, Colo., a major space contractor. "But that had absolutely no impact on the problem that occurred on the spacecraft."

Soyuz TM-5, commanded by veteran cosmonaut Vladimir Lyakhov and with Abdul Ahad Mohmand of Afghanistan on board, undocked from the Mir space station early Tuesday on what was expected to be a three-hour flight back to Earth. But the craft's braking rocket failed to fire on time and then, seven minutes later, fired automatically for three seconds.

Two orbits later, the rocket fired again, but shut down after about 60 seconds. This left the craft in a 155-mile orbit.

A third attempt was successful and the Soyuz landed safely and on target in the Soviet province of Kazakhstan.

Oberg said that based on Soviet public discussions and on tracking data collected by the U.S. Space Command in Colorado Springs, he believes the problem was caused by some type of computer "software glitch."

"The lighting at the de-orbit burn was not standard, and had never been followed in the four previous TM flights," said Oberg. "The TM is a completely re-engineered spacecraft with new computers, new software, new guidance."

He said the Soyuz TM aligns itself for the braking rocket firing by taking readings with a guidance sensor on the Earth's horizon. On the four earlier flights, these readings were taken as the Soyuz TM craft were approaching sunrise. For Soyuz TM-5, said Oberg, the readings were taken after sunset, in the darkness.

Oberg said he believes the "fault detection" system in the computer was "falsely rejecting the data" from the sensor.

"The computer disbelieved the data," he said. In the first attempt, the machine failed to fire the rocket until it received acceptable data. This came seven minutes too late, and the cosmonauts manually turned off the rocket after three seconds. Two orbits later, the computer turned the rocket on and it fired for about 60 seconds, Oberg said, before it again automatically halted the rocket engine.

"The cutoff of that burn was lucky for them," he said. "It was a lifesaving accident."