Sir Keir has travelled to Beijing with a delegation of British business and cultural leaders.
At the start of his meeting with Xi, the PM said he wanted a “more sophisticated” relationship with China.
Stressing the benefits at home of closer ties, he said: “I made the promise 18 months ago when we were elected into government that I would make Britain face outwards again.
“Because as we all know, events abroad affect everything that happens back in our home countries, from prices on the supermarket shelves to how secure we feel.”
Meanwhile, President Xi said UK-China relations had gone through “some twists and turns that did not serve the interests of our countries”.
He argued dialogue between the UK and China was “imperative” in a “turbulent and fluid” world.
He praised previous Labour governments for making “important contributions to the growth of China-UK relations” and told Sir Keir the two men would “stand the test of history” if they could “rise above differences”.
“Sometimes good things take time,” he said.
“As long as it is the right thing that serves the fundamental interests of the country and the people, then as leaders we should not shy away from difficulties and we should press ahead fortitude.”
The president quoted a Chinese proverb: “Range far your eye over long distances”.
Mentioning the upcoming Chinese new year, he said Sir Keir’s visit was “a sign of auspiciousness”.
Following the meeting, as a gift, Sir Keir gave President Xi a football used during last weekend’s Premier League match between Manchester United and Arsenal.
The PM is a keen Arsenal fan, while the president reportedly supports Manchester United.