Masked medical staff escorted the Mexicans into ambulances
Dozens of Mexicans quarantined in China because of fears they may be infected with swine flu are being flown home on a specially-chartered Mexican plane.
About 70 Mexicans were confined despite just one confirmed case of the virus.
The issue sparked a diplomatic row, with Mexico accusing China of targeting its citizens unfairly, and Beijing saying it was a "purely medical" issue.
Some 26 people have died of the virus in Mexico and more than 1,000 cases have been reported in 20 countries.
But just one fatality has been recorded outside Mexico - a two-year-old Mexican boy who died in the US while on a visit.
Mexico now puts the number of infections within its borders at 840.
In other developments:
• The World Health Organization says 1,490 people around the world have so far contracted the H1N1 swine flu virus. However, WHO figures often lag behind those announced by national government laboratories
• In the UK, delivery begins of specially-produced leaflets offering advice on swine flu and advice on how to prevent its spread
• South Korea reports its second confirmed case of swine flu, the first instance of human-to-human transmission in Asia.
The charter plane taking Mexicans out of China landed in Shanghai on Tuesday at about 1300 local time (0500 GMT) to pick up the first group of quarantined Mexicans.
Masked medical staff then escorted the Mexicans into ambulances to take them to the airport, before they cleared immigration and customs at a temporary outdoor facility.
The flight then continued on to Beijing, Guangzhou and Hong Kong before returning to Mexico City.
The quarantine row between Mexico and China developed after a 25-year-old man who had flown from Mexico to Shanghai and Hong Kong was diagnosed with swine flu - or H1N1.
Mexican officials said more than 70 of their citizens in China were confined. It is not yet clear whether or not these people had any contact with the infected traveller.
About 50 were being held in Shanghai in two five-star hotels, with 10 in Beijing and several more in the city of Wenzhou.
Masked Chinese set up a temporary immigration post for the Mexicans
China decided to track down everyone who landed on the same flight as the infected man and put them into quarantine. It also isolated everyone in the traveller's hotel in Hong Kong.
In Beijing, Yu Debin, deputy director of the Beijing Tourism Bureau insisted that those kept in the Guomen were treated "very well".
They had been given "luxurious" rooms complete with flowers, fruit, and toys for children to play with. A "special menu" was prepared to ensure the guests ate well, Mr Yu said.
However, one traveller quarantined in Beijing told Mexican radio that soldiers were guarding the hotel gates.
"This is like a kidnapping for us," Mirna Elisa Berlanga said, while Mexico has issued strongly-worded statements over the past few days condemning Beijing's response.
Meanwhile, another diplomatic row could be brewing after Canada asked China to explain why a group of at least 20 Canadian students had been quarantined in the north-eastern town of Changchun.
Canada said none of the students had shown any flu symptoms.
The US embassy said on Tuesday that four American citizens had also been quarantined in China due to swine flu fears.
Speaking on Mexican TV late on Monday evening President Felipe Calderon praised the country's precautions against swine flu and said children would soon begin returning to schools closed at the height of the scare.
Chinese authorities are taking no risks with the quarantined Mexicans
Large parts of Mexico's economy have been shut down since 1 May in an effort to stem the spread of the virus.
"Thousands of lives have been saved not only in Mexico but in the world," Mr Calderon said.
Hailing the "energy" with which Mexicans tackled the previously-unknown virus, Mr Calderon said the nation's "enormous effort" was helping the country avoid a major tragedy.
"The number of deaths recorded has notably decreased, and the numbers of cases of people infected with the virus has also reduced."
Pupils without symptoms of flu will begin returning to school on 7 May, the president said, adding that school buildings would also undergo a deep clean to limit chances of contamination.
Mexico will also begin a worldwide effort to repair the nation's tarnished international image in the hope of convincing tourists from around the world to continue visiting Mexico, including reducing entry and exit taxes for tourists.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.