United States president Barack Obama has told an audience in Shanghai that China and the US need not be adversaries.
Mr Obama was addressing a crowd of young people on Monday on his first presidential visit to China.
The students were vetted by the Communist party and the meeting was only televised live in Shanghai.
Mr Obama told the students that despite certain differences, the United States considers China an important partner on key global issues.
"The notion that we must be adversaries is not predestined, not when we consider the past," he said.
"Indeed, because of our cooperation, both the United States and China are more prosperous and more secure.
"We've seen what's possible when we build upon our mutual interests and engage on the basis of mutual respect."
Mr Obama said the US did not wish to impose any system of government on any nation, but would always stand up for its core principles of freedom and human rights.
"These freedoms of expression and worship, of access to information and political participation, we believe are universal rights," he said.
"They should be accessible to all people, including ethnic and religious minorities, whether they are in the United States or any other nation."
Mr Obama stressed the importance of an American-Chinese partnership on issues like climate change.
"All of us should have these certain obligations in terms of what our plan will be to reduce these greenhouse gases," he said.
"Other countries around the world will be waiting for us.
"They will watch to see what we do. And if they say, 'ah, you know the United States and China, they're not serious about this', then they won't be serious either."
He said Washington did not wish to contain China's rise but wanted trade between the two nations to be more balanced.
Mr Obama took questions from the audience on US arms sales to Taiwan, why he won the Nobel Peace Prize and respecting the attitudes of other countries.
On Tuesday he will meet his Chinese counterpart, Hu Jintao, in Beijing.