Image copyright Getty Images Image caption Xi Jinping and Donald Trump in 2017

After more than two years of rising tension, the US and China have signed a deal aimed at calming trade frictions. The agreement has been hard-fought, but it is unclear how much economic relief from their trade war it will offer.

Tariffs - in some cases at a lower rate - will remain in place. Analysts say it's unlikely that the deal will produce gains sufficient to outweigh the losses already suffered.

We take a look at the winners and losers from the deal.

Winner: Donald Trump

Some critics say there is little substance, but the signing offers an opportunity for US President Donald Trump to put the trade war behind him and claim an achievement heading into the 2020 presidential election.

That may be a relief: Polls show that most Americans agree with the president that China trades unfairly, but they generally support free trade and oppose tariffs. Indeed, Republicans lost several congressional seats in 2018 - a change economists have linked to the trade war.

Winner: President Xi Jinping

China appears set to emerge from the signing having agreed to terms it offered early in the process, including loosening market access to US financial and car firms. In many cases, companies from other countries are already benefiting from the changes.

While President Xi can claim he did not simply bow to America's demands, that doesn't mean the Chinese are celebrating. The Federal Reserve estimates that China's economy has taken a 0.25% hit, as US demand for its goods fell by about a third.

Loser: American companies and consumers

Image copyright Getty Images Image caption The US has collected more than $40bn in new tariffs

The new deal halves tariff rates on $120bn worth of goods, but most of the higher duties - which affect another $360bn of Chinese goods and more than $100bn worth of US exports - remain in place. And that's bad news for the American public.

Economists have found that the costs - more than $40bn so far - are being borne entirely by US companies and consumers. And that figure does not even try to measure lost business due to retaliation.

Overall, the Congressional Budget Office estimates that tariff-related uncertainty and costs have shaved 0.3% off of US economic growth, while reducing household income by an average of $580 since 2018.

The CBO's estimates take into account all new tariffs imposed since January 2018 - not just those involving China - but analysts say a more limited look would yield similar findings.

Loser: Farmers and manufacturers

Image copyright Getty Images Image caption Manufacturers exposed to tariffs have been hurt

The new deal commits China to boost purchases in manufacturing, services, agriculture and energy from 2017 levels by $200bn over two years.

Mr Trump has said that could include as $50bn worth of agricultural goods a year.

But the official figures are lower, analysts are sceptical those are attainable and China has said the purchases will depend on market demand. So far, the primary effect on business has been pain.

Farmers, who have been targeted by China's tariffs, have seen bankruptcies soar, prompting a $28bn federal bailout.

Among manufacturers, the Federal Reserve has found employment losses, stemming from the higher import costs and China's retaliation.

Over the long-term, American firms may reroute supply chains away from China to avoid the tariffs - but that's an expensive prospect.

Winners: Taiwan/Vietnam/Mexico

Image copyright Getty Images Image caption Ho Chi Minh City in southern Vietnam, the country's main manufacturing region

Globally, economists estimate that the trade war will shave more than 0.5% off of growth. But some countries have benefited from the fight, which redirected an estimated $165bn in trade.

Analysts at Nomura identified Vietnam as the country that would gain the most, while the UN found that Taiwan, Mexico and Vietnam saw US orders ramp up last year.

The Fed found that the increased American imports boosted Mexico's economic growth by just over 0.2%,

Some of those arrangements are likely to stick, even with a deal.

Loser: Washington China critics

Image copyright AFP/Getty Image caption Trump advisor Peter Navarro has pushed for a tough stance on China

The US has said that China has agreed to new protections for intellectual property, including lowering the threshold for criminal prosecution and increasing penalties. Critically, the two sides say they have agreed to a way to resolve such disputes.

Those were among the issues that ostensibly triggered the trade war.

But analysts say it's not clear if the new commitments are any different from promises that China has made before. And the new deal does not address some of America's chief complaints about China's trade practices - such as the subsidies it provides to certain industries.

The White House has said it will tackle additional issues in a second, "phase two" deal but analysts say they don't expect anything concrete anytime soon. The administration has also discussed how to address the subsidies with Japan and Europe.