Two Soviet cosmonauts returned safely to Earth today, leaving three others behind to continue operating an orbiting space station.

By successfully rotating the cosmonaut crews, the official Tass news agency said, the Soviets achieved a first and moved their space program closer to its goal of maintaining a permanently manned space station.

The return today of veteran cosmonauts Vladimir Dzhanibekov and Georgi Grechko, shown tonight on television parachuting in their capsule to a vast central Asian steppe, marked a "new stage" in the Soviets' latest space effort, Tass said.

Dzhanibekov, completing his fifth space flight, had been in space almost four months.

It was the fourth long-term expedition aboard the Salyut 7 orbiting station since it was launched in 1982. Left empty after the last mission ended in October, the station had suffered an electrical failure that created severe and dangerous problems for the cosmonauts.

The original crew, Dzhanibekov and Viktor Savinykh, arrived at the station June 8. Because of the power failure, they had to dock their Soyuz T13 spaceship manually, according to published accounts. For 10 days, they worked in difficult and hazardous conditions to restore power, heat and water to the station and to hook up radio communication.

Their ordeal -- they could work only two hours at a time because of the extreme cold -- was described in the press here last month, a rare and seemingly frank account of a problem on a Soviet space mission.

Last week, Grechko and two other cosmonauts -- Vladimir Vasyutin and Alexander Volkov -- joined the original two-man crew. Grechko, a senior engineer, is the Soviet Union's oldest cosmonaut at age 54.

Their spacecraft -- the Soyuz T14 -- is still docked at the orbiting station and will serve to bring the group back.

The overlapping of the crews means that the Salyut 7 will not have to be shut down and then restarted, an expensive and risky proposition, as Dzhanibekov and Savinykh learned.

"For the first time the crew was partially relieved, a fact which ensures a continuous operation of the piloted space complex for a long period of time and considerably enhances the effectiveness of its use in the interest of science and national economy," Tass said today.

The Soviet space program has emphasized endurance flights in space, with the ultimate goal of establishing large, permanently manned orbiting complexes. By contrast, the American space program has shifted to the concept of reusable spacecraft, or the shuttle.

The last Soviet space mission set a new record for human endurance in space when three crew members lived aboard the Salyut 7 for 237 days.