WASHINGTON (AP) — The U.S. and China ended two days of high-level talks on security and economy in upbeat fashion, but not before trading pointed remarks about National Security Agency leaker Edward Snowden and human rights.

The world's two largest economies announced their plans to negotiate a bilateral investment treaty and more cooperation on combating climate change.

But Deputy Secretary of State William Burns said the U.S. was very disappointed with how authorities in Beijing and Hong Kong handled Snowden's case by refusing to extradite him before he flew from Hong Kong to Russia.

"China's handling of this case was not consistent with ... the new type of relationship that we both seek to build," Burns said, referring to the summit a month ago between President Barack Obama and China's new president, Xi Jinping, at a California resort.

Obama also expressed disappointment about the Snowden case when he met Thursday in the Oval Office with the two leaders of the Chinese delegation, a White House statement said.

State Councilor Yang Jiechi retorted in his remarks at the talks that the handling of the Snowden case by authorities in semi-autonomous Hong Kong was "beyond reproach."

Yang also rejected U.S. criticism of China's rights record in the ethnic minority areas of Tibet and Xinjiang, saying people there are "enjoying happier lives and they enjoy unprecedented freedom and human rights."

He added: "We hope the U.S. will improve its own human rights situation."

About 120 Tibetans have set themselves on fire since 2011 to protest Chinese policies in Tibet and call for the return of the Dalai Lama, their exiled spiritual leader. In the far western region of Xinjiang, minority Muslims are agitating against Beijing, and clashes in recent months have killed at least 56 people.

The stark differences of opinion on those issues did not prevent kind words on both sides too.

U.S. Treasury Secretary Jacob Lew hailed the "personal approach" of China's new generation of leaders under Xi, who ascended to the presidency in March in a once-in-a-decade power transition.

China's Vice Premier Wang Yang, whom U.S. officials say has demonstrated a keen sense of humor in this week's talks, joked that Lew is smarter than he is and they've become good friends.

It's a sign of the importance the Obama administration puts on its relationship with China's leaders that the president received the visiting officials and did so in the Oval Office, where more typically heads of government and state are hosted.

Obama welcomed China's commitment to open its economy to U.S. investment in the bilateral investment treaty — a pact that Washington has been urging Beijing to negotiate in earnest for years. The Chinese also agreed with him on the importance of cooperating to get neighbor and ally North Korea to abandon nuclear weapons.

But Obama added that the United States would continue to speak out in support of international norms such as the protection of universal human rights, the White House statement said.