WASHINGTON (Reuters) - U.S. President Donald Trump on Tuesday defended his trade war with China as tensions escalated and markets extended their losses, promising a deal with Chinese President Xi Jinping soon, even as fears escalated about a protracted battle.

In a string of early-morning tweets, Trump kept up his “America First” agenda in support of hefty tariffs and called on U.S. companies to back him by shifting their businesses away from China. But he also softened his tone on soybeans and other agricultural products, appealing to Beijing to act.

“When the time is right we will make a deal with China,” Trump said. “It will all happen, and much faster than people think!”

“Hopefully China will do us the honor of continuing to buy our great farm product, the best, but if not your Country will be making up the difference,” he wrote in post addressing U.S. farmers directly.

Last week, the head of the U.S. Department of Agriculture said more aid was being planned for U.S. farmers but gave no details.

World stock markets hovered near two-month lows on Tuesday, although slightly more optimistic comments from U.S. and Chinese officials on trade brought some comfort a day after equities suffered their worst sell-off so far this year. [MKTS/GLOB] [.N]

A day earlier, Trump said he would talk to Chinese President Xi Jinping at a G20 summit in late June in Japan, and on Tuesday praised his “respect and friendship” with Xi.

Both sides had appeared close to finalizing a deal in recent weeks before Trump last week hiked up tariffs to 25% from 10% on $200 billion worth of goods imported from China.

He has also threatened further duties of up to 25% on a further $300 billion worth of Chinese imports.

China, in turn, has proposed tariffs on more than 5,000 American products.

Trump said on Tuesday he could make a deal with Beijing now, but would not be burned again and criticized China for scuttling a recent close deal with a last-minute attempt to renegotiate.

“We are in a much better position now than any deal we could have made,” he said, part of 10 tweets addressing the China talks, including a suggestion that the U.S. Federal Reserve tie interest rates to China’s if Beijing lowers rates.

He said he saw his administration’s trade efforts with China as a model for U.S. negotiations with other nations as he initiates talks with Europe and seeks to ratify a pact with Canada and Mexico.

“Other countries are already negotiating with us because they don’t want this to happen to them. They must be a part of USA action,” he said.