U.S. President Barack Obama chided Vietnam on political freedoms on Tuesday after critics of the communist-run government were prevented from meeting him in Hanoi, a discordant note on a trip otherwise steeped in words of amity between the former foes.

Obama announced on Monday that Washington was scrapping its embargo on the sale of lethal arms to Vietnam, clearing the biggest hurdle remaining between two countries that have been drawn together by concern over China's military build-up.

RELATED: 'Disgrace' as Vietnam veterans memorial vandalized

Critics said that by removing the ban, a vestige of the Vietnam War, Washington had put concerns about Beijing's assertiveness in the South China Sea first and given up a critical lever to push Hanoi for an improvement in human rights.

One prominent intellectual, Nguyen Quang A, told Reuters that about 10 policemen had come to his house at 6:30 a.m. and put him in a car that was driven out of the capital until Obama was about to leave the capital.

An outspoken lawyer said he was also stopped from joining a meeting that Obama held with six other civil society leaders.

Speaking later, Obama noted that several activists had been blocked from attending and said this was an indication that, despite some "modest" legal reforms "there are still folks who find it very difficult to assemble and organise peacefully around issues that they care deeply about."

"There are still areas of significant concern in terms of freedom of speech, freedom of assembly, accountability with respect to government," he said, adding in a speech later that upholding human rights is not a threat to stability.

Quang A, a former IT entrepreneur, was one of more than 100 Vietnamese who tried to run as independents for last weekend's election to the parliament, which is tightly controlled by the Communist Party. Almost all failed to get on the ballot.

Before he was taken away, Quang A posted on Facebook a photograph of himself dressing for the meeting with Obama, with the message: "Before going. May be intercepted, arrested. Advising so people know."

Vietnam's foreign ministry did not immediately respond to a request for comment.

Obama returned to human rights in a speech before leaving Hanoi, but he also dwelt on the importance of freedom of navigation in the South China Sea, where China has been turning remote outcrops into islands with runways and harbors.

"Big nations should not bully small ones. Disputes should be resolved peacefully," he said, without naming China, which claims sovereignty over 80 percent of the South China Sea.

RELATED: Anthony Bourdain and President Obama solve the world's problems over $6 noodles in Vietnam

In Beijing, Foreign Ministry spokeswoman Hua Chunying said countries outside the region should respect regional countries' efforts to safeguard regional peace and security. She said China believed a country's size should not be used as the only or main basis to determine if its position is justified.

"They key is whether the relevant party is sincere and determined in resolving disputes through joint efforts, negotiations, and consultations," she said.

China's Global Times, run by the Communist Party's official People's Daily, sneered at the decision to lift the arms embargo on Vietnam and said it showed Washington's willingness to relax standards on human rights for the sake of containing China.

The White House "is taking advantage of Vietnam to stir up more troubles in the South China Sea", it said.

Obama flew on to Ho Chi Minh City, the country's commercial hub, which was called Saigon until North Vietnamese tanks rolled into the city in April 1975 to bring U.S.-backed South Vietnam under communist rule.

Tens of thousands lined the road from Ho Chi Minh City's airport, many waving and chanting "Obama, Obama" as his motorcade rolled towards the century-old Jade Emperor Pagoda in the city centre. Some held handwritten signs that said: "Obama, we love you."

He is expected to emphasise the benefits of the Trans-Pacific Partnership (TPP) trade agreement between 12 Pacific Rim countries, which would remove tariffs within a 12-nation bloc worth a combined $28 trillion of gross domestic product.

Vietnam's manufacturing and export-led economy is seen as the biggest TPP beneficiary. Annual U.S-Vietnam trade has swelled from $450 million when ties were normalised to $45 billion last year, and Washington is a big buyer of Vietnam's televisions, smartphones, clothing and seafood.

RELATED: A Vietnam veteran's Missed Connection letter to an unknown woman who saved his life on the rainy streets of Boston

The TPP is not a done deal, with opposition expected in Washington amid concern about competition and a loss of U.S. jobs. Obama said he was confident the trade pact would be approved by legislators and he had not seen a credible argument that the deal would dent American business.

He will meet young entrepreneurs at one of the co-working spaces that host Vietnam's budget tech startups, which have been receiving attention from angel investors and Silicon Valley funds.