In a statement issued on Saturday, the Chinese Foreign Ministry described the talks as "open, constructive and very fruitful".
When he reacted sharply to Pompeo's mention of Taiwan, which considers China to be a stubborn province, but armed by Washington, Wei said Beijing will "defend its claim on the island" at all costs.
However, Wei and Mattis agreed that US-China military tensions needed to be reduced to avoid unintended clashes. The Chinese general said the confrontation would "be a catastrophe for everyone." Washington has protested to Beijing for the recent behavior of its warships, which the US Navy considers uncertain.
While Pompeo did not talk much about trade in his public commentary, Yang said he hoped that both sides would find a mutually acceptable solution to the topic "in brief".
China and the United States have tipped hundreds of billions of dollars in goods for each other's goods and rocked global financial markets, and Trump has threatened to tarnish the rest of China's exports of more than $ 500 billion to the United States if the trade dispute this can not be solved.
Trump's government has also accused China of meddling in US politics ahead of congressional elections this week.
With US growing concern over the Chinese cyber threat, a senior US intelligence official accused China on Thursday of violating a 2015 agreement aimed at reducing cyber espionage by hacking government and corporate data to stop.
Pompeo also reiterated US criticism of China's "suppression of religious groups" and referred to the treatment of Buddhists in Tibet and Muslim minorities from Uyghurs in the Xinjiang region, who were condemned by human rights groups.
Yang defended China's policies in Xinjiang as a measure against "ethnic separatist activity and violent terrorist crimes," but said it was a Chinese internal matter and foreign governments should not interfere.