BEIJING — On a visit that was supposed to be nonpolitical, Michelle Obama delivered an unmistakable message to the Chinese on Saturday, saying in an address here that freedom of speech, particularly on the Internet and in the news media, provided the foundation for a vibrant society.

On the second day of a weeklong trip to China with her two daughters and her mother, Mrs. Obama, the first lady, spoke to an audience of Americans and Chinese at Peking University, and in the middle of an appeal for more American students to study abroad, she also talked of the value for people of hearing “all sides of every argument.”

“Time and again, we have seen that countries are stronger and more prosperous when the voices and opinions of all their citizens can be heard,” she said.

The United States, she said, respected the “uniqueness” of other cultures and societies. “But when it comes to expressing yourself freely,” she said, “and worshiping as you choose, and having open access to information — we believe those are universal rights that are the birthright of every person on this planet.”

The forthright exposition of the American belief in freedom of speech came against a backdrop of broad censorship of the Internet by the Chinese government. The government polices the Internet to prevent the nation’s 500 million users from seeing antigovernment sentiment, and blocks a variety of foreign websites, including Twitter, Facebook and YouTube. The authorities compel domestic Internet sites to censor themselves.

Criticism of China’s top leadership is quickly deleted and is considered to be of particular concern to the censors. Obliquely, Mrs. Obama drew attention to this by making a comparison with the situation she and President Obama face in the United States.

“My husband and I are on the receiving end of plenty of questioning and criticism from our media and our fellow citizens,” she said. “And it’s not always easy, but we wouldn’t trade it for anything in the world.”

The White House has stressed that Mrs. Obama’s trip to China during the spring break of her daughters, Malia and Sasha, is intended to highlight the importance of education, and foreign exchanges in particular.

Mrs. Obama appeared at the Stanford University complex at Peking University, where she spoke to an audience of several hundred American students studying in China and some Chinese students who had studied in the United States. The president of Peking University, Wang Enge, welcomed her, and the new American ambassador to China, Max Baucus, who is a graduate of Stanford and its law school, also spoke.

On Friday, Mrs. Obama visited the elite Second High School Attached to Beijing Normal University, where, along with the Chinese student body, 30 Americans study, most of whom are from private schools in the United States and pay $50,000 annually in tuition. One of the American students in the program came from the Sidwell Friends School in Washington, which Malia and Sasha attend.

But in her speech, Mrs. Obama said that study abroad should not be just the preserve of the rich. “Too many students never have this chance, and some that do are hesitant to take it,” she said. “They may feel like study abroad is only for wealthy students, or students from certain kinds of universities.”

Others ask how useful study in a foreign country would be to their lives, Mrs. Obama said. In reality, study abroad is vital for people who want to participate in a world in which countries and economies are increasingly interconnected, she said.

During his visit to China in 2009, Mr. Obama announced a program, called 100,000 Strong, that was devised to send more American students to China.

But the effort struggled under the auspices of the State Department and was recently transformed into a nonprofit foundation based at American University in Washington in an attempt to encourage more funding and attract more students.

About 200,000 Chinese students are enrolled in institutions in the United States, according to the State Department. About 20,000 American students are studying in China, the department says.

The president of the 100,000 Strong Foundation, Carola McGiffert, said recently that a lack of knowledge about China among students in the United States stopped some from considering China as an option for study abroad.

In an informal session with students after her speech, Mrs. Obama said that fear was often an inhibitor to studying abroad.

Life is about “not letting fear be your guide,” she told the students who participated in a videoconference between the Stanford campus in California and the campus in Beijing.

A version of this article appears in print on , on Page A4 of the New York edition with the headline: In Beijing Talk, Michelle Obama Extols Free Speech. Order Reprints | Today’s Paper | Subscribe