President Biden on Monday met with Chinese President Xi Jinping and said in their first in-person meeting since Biden took office that the two leaders should manage their differences.

“As the leaders of our two nations, we share a responsibility, in my view, to show that China and the United States can manage our differences, prevent competition from becoming anything ever near conflict and to find ways to work together on urgent global issues that require our mutual cooperation,” Biden said to Xi to open their meeting in Bali, Indonesia.

“And I believe this is critical for the sake of our two countries and the international community,” Biden added, saying that the meeting should last a few hours.

Biden and Xi are in Bali for the Group of 20 summit. They shook hands at the beginning of the meeting and smiled and posed for photographs in a room with both the American and Chinese flags.

Biden said that he is “committed to keeping the lines of communications open” between himself and Xi, adding that the U.S. and China “have so much that we have an opportunity to deal with.”

Additionally, the president said he is ready to work with China to address global challenges from the climate to food insecurity.

“The United States stands ready to do just that — work with you — if that’s what you desire,” Biden said.

Biden and Xi have had five phone or video calls since Biden took office, with their last face-to-face meeting occurring in Davos, Switzerland, in 2017. Xi met with former President Trump in 2019.

Biden said in a press conference last week that he would address his views on U.S. commitments to Taiwan’s defense in the bilateral meeting with Xi. Biden has often said that he believes the U.S. should come to Taiwan’s defense if China were to launch an invasion, remarks that have led the White House to attempt to clarify that such defense falls short of American military intervention.

Xi, in his opening remarks on Monday, said that lessons can be learned from the U.S. and China’s over-50-year relationship.

“History is the best textbook, so we should take history as a mirror and let it guide the future,” Xi said. “Currently, the China-U.S. relationship is in such a situation that we all care a lot about it, because this is not the fundamental interests of our two countries and peoples and it is not what the international community expects [from] us.”

He also said that a “statesman” should “think about and know how to get along with other countries and the wider world.”

And the Chinese leader said that the world is watching and expects the U.S. and China to “properly handle the relationship.”

Reporters traveling with Biden listened to the opening remarks at the top of the meeting. As they were being ushered out of the room where the meeting was to take place, a member of the U.S. press called out to Biden, asking whether he would raise human rights during the talks.

A man from the Chinese side yanked the producer backward by her backpack. She lost balance without falling and was pushed toward the door. Two White House staff members intervened, saying the producer should be left alone.

Monday’s meeting on the sidelines of the G-20 follows better-than-expected midterm elections for Biden, with Democrats holding on to control of the Senate. Control of the House is still uncertain, however.

Additionally, Xi secured a third term as president late last month, which cements his power for the next five years.