Americans’ views of China have become more positive over the past year, a new Pew Research Center survey finds.

Ahead of Chinese President Xi Jinping’s meeting Thursday with US President Donald Trump, the survey finds 44% of Americans have a favorable opinion of China, up from 37% a year ago.

These numbers may come as a surprise, as Trump relentlessly lashed out at China during last year’s US presidential election campaign.

The growth in positive ratings for China may be due in part to declining concerns about economic threats from China.

The share of the American public that sees the amount of US debt held by Beijing, the loss of jobs to China and the trade deficit with China as very serious problems has dropped significantly in recent years.

For example, 61% said the trade deficit was a very serious problem in 2012, compared with 44% today. Concerns about Chinese cyberattacks have, on the other hand, risen to 55% from 50% five years ago.

Still, debt, trade and jobs have not disappeared as sources of concern for Americans, and overall about half the public (52%) continues to see China as more of an economic threat than a military one.

China is viewed as principally a military threat by slightly more than a third of Americans (36%).

If an Asian ally such as Japan, South Korea or the Philippines were to become embroiled in a military conflict with China, most Americans (58%) would back the use of force against Beijing.

Nearly two-thirds of Republicans (65%) and 62% of independents hold this view. And by a 52%-39% margin, Democrats also favor using force to defend an Asian ally.

Economic and military issues are not the only concerns the public has about China – many also name cyberattacks, China’s impact on the environment and Beijing’s human rights policies as major problems.

In general, Republicans hold more negative attitudes toward China and express stronger worries about economic challenges in the US-China relationship.

Most strikingly, 71% of Republicans say job losses to China are a very big problem for the US, compared with only 47% of Democrats.

While jobs are the top Republican concern about China, among Democrats it is China’s impact on the global environment. More than six-in-ten Democrats (63%) call it a serious problem, compared with only 44% of Republicans.

President Xi gets largely negative ratings from Americans: 60% have not too much or no confidence in him to do the right thing in world affairs. Just 31% say they have a lot or at least some confidence in the Chinese leader.

These are among the key findings of a new Pew Research Center survey, conducted among 1,505 respondents in the United States from February, 16 to March 15, 2017.