Two Soviet cosmonauts successfully refueled their orbiting space lab from an accompanying cargo craft yesterday, the government reported, the first time such a dangerous feat has been achieved in the history of manned spaceflight.

The refueling required cosmonauts Yuri Romanenko and Georgi Grechko to pump highly corrosive and volatile rocket fuels from the Progress One cargo ship into the tanks of the Salyut 6 space lab. Even on the ground, handling rocket fuels such as hydrazine and nitrogen tetroxide is demanding and dangerous. Both are fatal if inhaled even in small quantities.

Western sources here called the feat a major step forward for the Soviets toward their goal of assembling large manned complexes capable of indefinite orbital flight.

The Soviets did not make clear exactly how the fuel transfer was carried out. Some observers here had speculated that it would require a "spacewalk" for a cosmonaut to complete connection of fueling pipes. The official Tass news agency did not disclose whether such an excursion occurred. In the past, the agency has reported such "walks."

Just how the fuels were pumped from one craft to the other without any benefit of gravity was unclear, according to U.S. sources. They said the cosmonauts probably pumped helium gas under pressure into the cargo ship's tanks. The pressurized helium would force the fuel out of the tanks and into the fuel lines that carried it to the Salyut.

Tass said the cosmonauts "began work in filling the fuel tanks of the station" after completing a lengthy checkout of the "fueling pipes and automatic facilities." It added, "According to telemetric information and reports from the cosmonauts, the Salyut 6 refueling program has been completely carried out. The onboard systems of the complex function smoothly. The cosmonauts feel well."

The cargo craft was rocketed into space Jan. 20 and successfully linked up with the Salyut itself a space first. Since then, Romanenko and Grechko have been spending much of their time readying the fuel transfer.

The cosmonauts have been aboard the Salyut since Dec. 11. In mid-January, they were visited by two other cosmonauts another first for the Salyut flights. Romanenko and Grechko, who are featured nightly on the national television news, are approaching the Soviet record of 63 days in space for a previous crew. The United States holds the record of 84 days in space aboard a Skylab.

The Soviet space program, after delays, accidents, and tragedy, now seems solidly advancing in a manner that is both daring and well-reasoned, according to several sources here. With a smaller payload capability than the Americans and technology that Western experts consider substantially cruder than the American, the Soviets have moved steadily to apply their hardware in more complex ways.

The Salyut lab, weighing about 19 tons, is the sixth in this series. This one was launched last fall but the first cosmonauts who tried to dock with it failed, causing the Soviets public embarrassment just when they were looking for a space spectacular to help celebrate the 60th anniversary of the Soviet revolution. But a few weeks later, the Soviets launched Romanenko and Grechko.

One Western expert pointed out that several years ago, the Soviets experimented during a Salyut flight with the transfer and pumping of liquids in a weightless condition. This experiment, the observer suggested, was a precusor to today's fuel transfer. The source said it is his view that the Soviets will continue making strides based on individual achievements involving their present spacecraft and rockets.