Russia on Tuesday banned the sale of its oil and petroleum products to countries that impose a price cap on them in a move that threatened more uncertainty ahead for global energy markets.

Moscow’s move was a response to an agreement by the U.S. and its allies to bar the shipping, financing or insuring of seaborne Russian crude unless it is sold for $60 a barrel or less—a sanction leveled in response to Russia’s invasion of neighboring Ukraine.

Whether Russian President Vladimir Putin’s order will significantly disrupt supply in the world’s oil market will depend on how Russia implements it.

Many of Russia’s crude exports are now selling at market prices well below the $60 cap—primarily to countries including India, China and Turkey, which haven’t agreed to join the Western sanctions.

If Mr. Putin decides to cut off oil exports to those non-Western buyers, it could have a major impact. If only countries that crafted the sanctions are targeted, the impact would be much more muted since they have already banned most Russian imports.

A decree signed by Mr. Putin on Tuesday described the Western moves as unfriendly and contrary to international law and said Russia’s prohibition on sales would start Feb. 1 and last through July 1.

Deliveries of Russian oil to countries that impose the price cap would be allowed with special permission by Mr. Putin. Russia’s Ministry of Energy was charged with monitoring implementation of the rules.

Joining the U.S. in imposing the novel price-cap sanction on Dec. 5 were the Group of Seven advanced democracies, the 27 members of the European Union and Australia.

A European Commission spokeswoman said Tuesday that the EU adopted in June a complete import ban on all Russian seaborne crude oil and petroleum products, which covered 90% of the oil imports from Russia at the time.

“The EU’s full import embargo has remained not affected by the oil price cap decided by the G-7 at the beginning of December,” she said.

Hungary and several other landlocked EU nations pushed for exemptions to the embargo to keep importing pipelined Russian oil. Mr. Putin may now shut off those flows.

A spokesman for the U.S. Treasury Department, which came up with the price cap proposal, declined to comment on Mr. Putin’s decree. The U.S. has stopped importing Russian oil.

Limiting the price for which Russia can sell its oil is aimed at denting the Kremlin’s war chest while still keeping Russian oil flowing to markets—and therefore stabilizing global prices. But oil and ship-tracking analysts say Russia’s crude output has nevertheless declined since the widening array of sanctions came into effect.

Russia has exported about 2.5 million barrels of its crude each day by sea in December so far, according to commodities-data firm Kpler. That is down 22% from the average for the first 11 months of the year.

That decline is likely due to harsh winter weather and weak demand from China as its pandemic reopening has faltered, said Matt Smith, a Kpler oil analyst.

“The number of buyers of seaborne Russian crude has dropped to half a dozen or so countries,” he added, namely India and China.

Global oil prices have edged higher in recent weeks as Russian supplies have come off the market and stop-and-start public-health notices from Beijing signal the Chinese economy coming back online next year. Futures contracts for Brent crude, the global price gauge, edged about 0.5% higher Tuesday to $84.33 a barrel.

As traders and investors have tried to price in the sanctions on Russian oil, the Kremlin and its trading partners expanded a global “shadow fleet” of tankers to ship crude exports without Western financing or insurance. Still, some recent oil shipments from Russia also have proceeded with the help of Western companies in line with the price cap’s design, according to people familiar with the trades.

Late last week, Russia’s mainstay Urals crude sold at $42.40 a barrel from the Baltic port of Primorsk, according to Argus Media, which tracks commodity prices.

It is unclear if Mr. Putin’s decree will result in Russia curbing shipments that are sold at market rates to buyers in India, for example, and facilitated by Western services.

Robert Yawger, executive director of energy futures at Mizuho in New York, said data indicate some buyers in Southeast Asia appear more reluctant now to snap up sanctioned barrels, leaving some tankers adrift in the Asia Pacific market.

“They’re looking for a home in India and China, but [those countries] have all the crude they need right now,” Mr. Yawger said. “They’re loaded up.”

Even so, market participants aren’t likely to miss the Russian barrels, for now. Global demand for crude oil has softened in recent months, and despite a recent three-week rally following China’s reopening and severe cold weather, U.S. oil prices could test the $70-a-barrel mark in the coming weeks if economic activity continues to languish, Mr. Yawger said.

“The demand side of the equation is a bigger deal right now,” Mr. Yawger said. “Supply isn’t really a problem.”

The Kremlin has played down the impact of trying to cripple Russia’s energy resources. On Thursday, Mr. Putin said he doesn’t see any potential losses for the Russian oil-and-gas sector from Europe’s price cap.

His Tuesday directive followed an announcement last week by the country’s energy minister, Alexander Novak, that Moscow could cut oil output in response to the Western price caps, reducing its production by 500,000 to 700,000 barrels a day—which he described as a 5% to 7% reduction in capacity—by early next year.

European countries, meanwhile, are preparing a February ban of refined petroleum products such as diesel that some analysts expect to have a greater impact on global markets. Western countries also will impose price caps on Russian petroleum products in February.

The energy conflict running in tandem with the war has contributed to “an unprecedented amount of uncertainty on the supply side and resulting volatility in oil markets,” said Paul Sheldon, a geopolitical risk analyst at S&P Global Commodity Insights.

Write to Ann M. Simmons at ann.simmons@wsj.com, Andrew Duehren at andrew.duehren@wsj.com and David Uberti at david.uberti@wsj.com