President Reagan yesterday ordered sanctions lifted against companies involved in building the Soviet natural gas pipeline after what he said was "substantial agreement to a plan of action" on strategic aspects of East-West economic trade.

The sanctions had been the source of a growing rift between the United States and its major European allies, and yesterday's announcement followed weeks of intensive negotiations to find agreement on a face-saving alternative for the Europeans and the Reagan administration. Whether there is such agreement was thrown immediately into doubt, however, when the French government said in Paris that it "is not a party to the agreement announced this afternoon in Washington."

Diplomatic sources close to the negotiations here over the last several weeks said the French announcement was "unexpectedly harsh."

They noted, however, that it left open the possibility that France might agree eventually to join in developing an East-West trade strategy after making its point that the effort had no relation to the pipeline sanctions.

France has stridently pictured them as an "obnoxious" U.S. problem that Washington must solve by itself.

France said it "noted" the announcement of the lifting of sanctions. Other European countries with companies affected by the sanctions -- Italy, West Germany and Britain -- said they welcomed the Reagan announcement, made in his weekly radio broadcast.

White House deputy press secretary Larry Speakes said he had understood that France was "in substantial agreement" on East-West economic issues, as announced by the president.

Speakes noted that "there have always been differences in perception on the . . . relationship of the sanctions to the overall agreement on economic issues which the president announced."

U.S. officials said the timing of the announcement was not intended as an "olive branch" to the new Soviet leadership, and Reagan said on leaving the White House for a brief trip to Chicago that it was not linked to the Soviet transfer of power or the release of Solidarity union leader Lech Walesa in Poland. Asked what kind of signal he wanted to send the new Soviet leadership, Reagan said: "I hope the signal will be that we are ready for a better relationship anytime that they are."

In Moscow, there was no direct reaction to Reagan's announcement, but Soviet television highlighted Reagan's visit yesterday morning to the Soviet Embassy here to sign a book of condolences on the death of Soviet President Leonid I. Brezhnev. Details on Page A23.

Reagan imposed the sanctions against U.S. companies after imposition of martial law in Poland last December.

They were extended to foreign companies using U.S. technology in June following the collapse of efforts to reach a limited agreement on East-West trade at the economic summit meeting in Versailles.

Within days of the presumed accord at Versailles, Paris and Washington exchanged bitter recriminations in an atmosphere that spread to other European countries following the extension of sanctions, threatening the cohesion of the Atlantic Alliance.

Under the sanctions, selected U.S.-made or -licensed oil and gas equipment was embargoed to companies that shipped items for the Soviet natural gas pipeline to Western Europe.

U.S. companies or their subsidiaries lost an estimated $2.2 billion in existing contracts as a result of the sanctions.

Potential losses from possible new contracts lost to the U.S. or European companies under the sanctions are believed to have run into the millions of dollars.

The sanctions were designed to put pressure on Moscow, which in turn would presumably influence Warsaw to moderate its actions against the Solidarity movement.

At the same time, administration officials made it clear that they also hoped to deny the Soviet Union the billions of dollars in hard currency that it would receive from the sale of natural gas to Western Europe and might use to buy or develop sophisticated military technology.

From the outset, the administration said it would lift the sanctions if the Polish government freed Walesa and other internees, ended martial law and opened talks with Solidarity and the Catholic Church, or if the Europeans came up with "more effective" measures against the Soviets.

After George P. Shultz replaced Alexander M. Haig Jr. as secretary of state, there was a shift in U.S. strategy and, rather than waiting for European alternatives, Washington began developing ideas and seeking a consensus among the Europeans.

"I am pleased to announce that the industrialized democracies have this morning reached substantial agreement to a plan of action," Reagan said in his broadcast. "The understanding we have reached demonstrates that the Western Alliance is fundamentally united and intends to give consideration to strategic issues when making decisions on trade with the U.S.S.R.

"As a result, we have agreed not to engage in trade arrangements which contribute to the military or strategic advantage of the U.S.S.R. or serve to preferentially aid the heavily militarized Soviet economy."

Reagan and senior administration officials who later briefed reporters on the announcement said the United States, Canada, Japan, West Germany, Britain, France and Italy, along with other Common Market countries, had agreed to develop policies in the areas of energy trade with the Soviet Union, "harmonization" of credit policies and strengthening existing controls on sale of strategic items to the Soviet Union.

While the studies are under way, Reagan said that there would be no new contracts for purchase of Soviet natural gas and that procedures for monitoring financial relations with the Soviet Union would be established "without delay."

U.S. officials said that there would be no signed agreement in the sense of a treaty but that there would be a common text reflecting the intensive negotiations.

"The so-called study is a work program, a commitment to follow up in these areas," one senior administration spokesman said when questioned about how the Washington announcement differed from what had been agreed upon at Versailles.

He also said the Washington accord was explicit about credits, energy and transfer of high techology, all areas that he said had not been covered by the Versailles communique. When U.S. officials tried to interpret the Versailles communique as covering some of these issues, the consensus had quickly broken down.

"This is a very high-stakes agreement," another official said, noting that the Soviets were likely to be able to complete the pipeline currently under construction and that it was the goal of the planned energy studies to avert planned second and third pipelines that would make Western Europe dependent on Moscow for as much as 40 percent of its natural gas.

The official said the credit study, acknowledged by all concerned as probably the hardest area to negotiate, was designed to go beyond the current agreement on a common interest rate to include down payments, length of loans and other terms. "If the study groups work out, it is a big gain for the alliance," the official said. "Before we had no agreement to get involved in these kinds of studies . . . But it takes time. These are not simple one-day negotiations. You can't get every jot and tittle quickly."

Officials said that the sanctions orders of Dec. 30, 1981, and June 27, 1982, would be lifted effective yesterday and that companies can again ship and sell oil and gas transmission equipment to the Soviet Union.

Contracts to sell oil and gas exploration equipment will be judged on a "case-by-case basis," the official said, noting that standing national security standards on sales to the Soviet Union and Poland will still be applied.

"Caterpillar and General Electric can fulfill existing contracts and can compete with foreign companies for contracts," the official said. These two companies were particularly hard hit by the sanctions, as was Dallas-based Dresser Industries.

How much business can be recouped is unclear, however, since some contracts, particularly those for pipeline-laying equipment in which Caterpillar was involved, have gone to Japanese companies.

Caterpillar public affairs spokesman Steve Newhouse said, "We welcome it. Perhaps it will open the doors to allow us to rebuild a trade structure with the Soviet Union."

" . . . The United States imposed sanctions against the Soviet Union in order to demonstrate that their policies of oppression would entail substantial costs," Reagan said in his broadcast.

"Now that we have achieved an agreement with our allies which provides far stronger and more effective measures, there is no further need for these sanctions and I am lifting them today.

"The process of restoring a proper balance in relations with the Soviet Union is not ended. It will take time to make up for the losses incurred in past years. But acting together, we and our allies are making major progress, and I am happy to say the prospects for peace are brighter." CAPTION: Picture, Pipeline sanctions cost U.S. companies or their subsidiaries an estimated $2.2 billion. UPI