(Reuters) - China has agreed to buy two types of rare earth metals from the United States as part of an initial trade deal inked on Wednesday, a move likely to boost U.S. production of the strategic minerals.

The agreement, signed in Washington by Chinese Vice Premier Liu He and U.S. President Donald Trump, gives China two years to ramp up purchases of hundreds of U.S. products, including scandium and yttrium, two of the 17 rare earths commonly used in lighting and computers.

It was a surprising about-face for China, whose status as the top global producer of the specialized minerals used to make electronics, military weapons and other high-tech equipment was seen as giving it leverage in its trade war with Washington.

Chinese President Xi Jinping visited a rare earths facility last May, a step widely interpreted as threatening exports to the United States, which are at their lowest level since 2015.

The trade agreement does not involve neodymium or praseodymium, the two most commonly used types of rare earths. China dominates their production, as well as the manufacture of rare earths magnets. After rare earths are processed, they must be turned into magnets, otherwise they are of little value to electronics and weapons manufacturers.

Neither scandium nor yttrium are currently produced in the United States. However, several junior miners are developing U.S. mines to produce them and other rare earths.

The initial trade deal effectively gives those junior miners a guaranteed customer, a step that should help in the hunt for project financing.

"This provides an additional market for U.S. producers," said Anthony Marchese, chief executive of Texas Mineral Resources Corp TMRC.PK, which is developing the Round Top mine in Texas with USA Rare Earth.

The Round Top project has scandium and yttrium deposits, as do projects under development by UCore Rare Metals Inc UCU.V and Rare Element Resources Ltd REEMF.PK.

The trade deal comes as the Pentagon has moved in recent months to help fund U.S. rare earth and rare earth magnet projects, part of an attempt to help create a domestic supply chain free from China, according to documents seen by Reuters.

The rare earths tension between the two countries goes back to at least 2010, when China limited exports to Japan after a diplomatic dispute, sending prices for the niche metals spiking and fueling concerns across the U.S. military that China could do the same to the United States.