China's Communist Party chief and Taiwan's opposition Nationalist leader have agreed at historic talks to work to reduce cross-strait tension.
The handshake was broadcast on Chinese and Taiwanese TV
They made a commitment to "promote the reaching of an agreement to end the hostile situation", a spokesman said.
It was the first meeting between party leaders since the Nationalists lost the civil war and fled to Taiwan in 1949.
Taiwan's government criticised the talks, saying they had done nothing to improve cross-strait relations.
China's leader, Hu Jintao, said his meeting with Taiwan's Lien Chan had "injected new vitality" into cross-strait relations.
But a statement from Taipei noted that Mr Lien had failed to persuade Beijing to recognise Taiwan's sovereignty, or to reduce the number of missiles pointing towards Taiwan from the mainland.
"We feel deeply disappointed that China had failed to show the slightest sincerity in improving relations with the Republic of China (Taiwan's official name)," said Joseph Wu, chairman of the cabinet-level Mainland Affairs Council.
Mr Lien conceded that whether Taiwan acted on Friday's agreement depended on the island's government in Taipei.
Taiwanese President Chen Shui-bian's ruling Democratic Progressive Party (DPP), which in the past has backed independence from China, has been uneasy about Mr Lien's visit from the start, and had warned him against signing any agreements with Beijing's leaders.
"The Nationalist Party as an opposition party can only put it forward as a suggestion," Mr Lien said of the agreement he reached with Mr Hu.
"How to carry it out depends on what importance the government attaches to it," he was quoted as saying.
China sees Taiwan as part of its territory and has threatened to use force if the island declared formal independence from Beijing, a position which leads to regular wars of words with the DPP.
Lien Chan and Hu Jintao greeted each other warmly as they met in the Great Hall of the People in Beijing.
Mr Hu described Mr Lien's trip as a great thing.
"This meeting today is a historic meeting between the leaders of our two parties," Mr Hu told his guest.
Lien Chan has been receiving a warm welcome in Beijing
"Although differences between our two parties remain, as long as both sides can place importance on the interests of the Chinese nation... we will be able to overcome differences and create a bright future."
Mr Lien said he hoped the two sides could seize the opportunity to bring about a better future.
"We cannot change the past, but we can grasp the opportunities of the future... We need reconciliation and dialogue."
After a private meeting, the two sides issued a joint statement, saying they were committed to "seeking the peace and stability of Taiwan, pushing forward the development of cross-strait relations and safeguarding the interests of the compatriots on both sides of the strait".
Both sides repeated their previously stated positions opposing Taiwan's independence. The Nationalists have said before they favour eventual reunification, so long as China is by then democratic.
While China has given a warm welcome to the Taiwanese delegation, the visit has provoked a mixed reaction back in Taipei.
HAVE YOUR SAY
Both China and Taiwan needs friends, who better than each other
A BBC correspondent there says that while some people are in favour of any attempt to reduce tensions with Beijing, others are concerned that Mr Lien's visit will add to tensions between the ruling party and the Nationalist opposition.
The Nationalists, also known as the Kuomintang (KMT), were for decades implacably opposed to dealing with China's Communists.
But since they lost power in 2000 they have increasingly favoured closer ties, especially for promoting business interests.