BEIJING (AFP) - The United States and China will work to keep their latest tit-for-tat trade spats from escalating into an all-out war, a top US official said Tuesday, just days before a visit by President Barack Obama. Robert Hormats, the US Under Secretary of State for Economic, Energy and Agricultural Affairs, said tensions, misunderstandings and frictions were inevitable between major trade partners and could be resolved through talks. We have trade disputes with a lot of countries with whom we have very close economic ties and they have trade disputes with us, Hormats said in a speech to university students in Beijing ahead of Obamas visit, which begins Sunday. Many of these things can be negotiated out before they get to the WTO stage. I think we will do and China will do everything we can to avoid a trade war. Tensions between the two countries intensified late last week when the United States slapped anti-dumping tariffs of up to 99 percent on imports of some Chinese steel products used in the oil industry. China branded the decision an abuse of protectionism and retaliated by launching its own probe into US car imports. The worlds number one and three economies have traded a series of accusations of unfair trade practices since September when the Obama administration announced it would slap duties on Chinese-made tyres. Hormats said Obama would discuss the trade disputes as well as energy cooperation and climate change with his Chinese counterpart Hu Jintao during his November 15-18 visit. Our two countries are perhaps the most important players (in the world) and to make it work, we have to work together, Hormats said. Obama had hoped to reach an agreement with Hu on global warming so the two nations could go to key climate change talks in Copenhagen in December with a green initiative, Hormats said, without elaborating. The success of the Copenhagen summit will depend ... on China and the US and other countries taking action, Hormats said.