BEIJING — Prince William presented China's president with a large envelope Monday containing an invitation from the queen to visit Britain this year, as he began the first official visit to mainland China by a senior British royal in a generation.

President Xi Jinping told the prince that he thanked Queen Elizabeth II for the invitation. "I look forward to meeting her majesty and other British leaders during the visit and to jointly plan out the future of Sino-British relations," Xi said during the meeting in the Great Hall of the People, the seat of China's legislature. "The British royal family has great influence, not just in Britain but across the world."

The prince's three-day trip to Beijing, Shanghai and in the southwest near the border with Myanmar is testing the prince's diplomatic mettle as the second in line to the throne.

He won't be visiting Hong Kong, which Britain handed back to China in 1997. It was the scene last year of weekslong pro-democracy protests, during which Beijing prevented a parliamentary committee from traveling to Hong Kong to investigate political reform there, saying it did not want Britain interfering in its internal affairs.

William told Xi and the rest of the Chinese delegation, including Yang Jiechi, the government's senior foreign policy adviser, and Foreign Minister Wang Yi, that he was looking forward to strengthening relations between the countries.

"I'm particularly interested in the young people and seeing how the next generation develops and is aware of the world as it is," he added.

Earlier Monday, Prince William told a boy he might be able to make his dream of singing opera in a palace come true as he met with young people from disadvantaged backgrounds.

He made the comment as he toured a traditional Beijing courtyard residence dating from the 1890s that has been restored and turned into a museum with help from charities related to his father, Prince Charles: the Prince of Wales's China Foundation and The Prince's Foundation for Building Communities.

He spent most of his time chatting with representatives of charities helping children with hearing and visual impairments, whose parents are migrant workers or in prison, and some of the young people they work with.

Zhao Chen, 14, who is visually impaired and undergone six operations to his eyes, and wants to be a tenor, told the prince: "My dream is to go to your palace to sing opera."

The prince replied: "Well, you have met the right man. We might be able to arrange something."

Before he left, William was presented with a picture drawn by a 10-year-old of a rural scene, and said he would give it to his son: "That will look nice in George's bedroom."

Prince William also had a stroll in the Forbidden City, where emperors once resided. He is due to arrive in Shanghai on Monday evening, where his engagements include opening an exhibition showcasing British creativity and innovation and meeting with Chinese business leaders; watching students at a secondary school train with Premier League-trained coaches; and meeting Chinese film industry figures. His final stop in China is Xishuangbanna in Yunnan where he will visit an elephant sanctuary and a nature reserve.

William arrived in Beijing late Sunday after a four-day stay in Japan. Interest in his visit among Chinese was limited without the presence of wife Kate, who is expecting their second child next month. Xi offered the couple his congratulations.

Relations between Britain and China got back on track after Beijing suspended high-level diplomatic contacts for 14 months after Prime Minister David Cameron met with the exiled Tibetan spiritual leader, the Dalai Lama, in May 2012.

In June last year, Chinese Premier Li Keqiang's visit to Britain was marked with pomp and ceremony, involving a meeting with the queen and the announcement of 14 billion pounds ($24 billion) worth of business deals.