HANOI, Vietnam — The United States is rescinding a decades-old ban on sales of lethal military equipment to Vietnam, President Obama announced at a news conference in Hanoi on Monday, ending one of the last legal vestiges of the Vietnam War.

The United States has long made lifting the embargo contingent on Vietnam’s improving its human rights record, and recently administration officials had hinted that the ban could be removed partly in response to China’s buildup in the South China Sea.

But Mr. Obama portrayed the decision as part of the long process of normalizing relations between the two countries after the Vietnam War.

“The decision to lift the ban was not based on China or any other considerations,” he said, with the Vietnamese president, Tran Dai Quang, standing stiffly by his side. “It was based on our desire to complete what has been a lengthy process of moving toward normalization with Vietnam.”

Mr. Obama insisted that the move should not be interpreted as carte blanche for weapons sales to Vietnam and that the United States would review future arms sales to “examine what’s appropriate and what’s not,” as it does with any country.

As for human rights, he said, “this is an area where we still have differences.”

Human rights advocates, who had asked Mr. Obama to hold off on lifting the ban until Vietnam had released some prominent political prisoners and promised to stop the police beatings of protesters, condemned the decision.

“President Obama just gave Vietnam a reward that they don’t deserve,” said John Sifton, the Asia policy director of Human Rights Watch.

Mr. Quang defended his country’s rights record.

“The consistent position and viewpoint of the Vietnamese government is to protect and promote human rights,” he said, adding, “Those achievements have been highly recognized and appreciated by the international community.”

American officials have portrayed lifting the embargo as part of a strategy to help Vietnam defend itself against an increasing threat from China in the South China Sea. Analysts have speculated that in return, Vietnam would grant the United States access to the deepwater port at Cam Ranh Bay.

While there were no statements about such a deal on Monday, Mr. Obama did announce new commercial agreements worth more than $16 billion, including one in which Boeing will sell 100 aircraft and Pratt & Whitney will sell 135 advanced aircraft engines to VietJet Air, a privately owned low-cost airline.

Analysts said, however, that the potential market for new military contracts with Vietnam was likely to be limited in the near term.

Mr. Obama said that improved ties with Vietnam made sense for the United States, since it was a fast-growing country in one of the fastest-growing regions of the world.

He predicted that the Trans-Pacific Partnership, a trade deal among 12 nations, including Vietnam, that has very little chance of passing Congress before the November election, would someday become law. All three remaining presidential candidates oppose it.

Mr. Obama’s visit was part of an effort by Vietnam to recalibrate its relationship with China, its giant neighbor in the north. China remains Vietnam’s largest trading partner and an ideological ally, but the two countries have sparred over Beijing’s claims to waters off Vietnam’s coast in the South China Sea.

Since 2014, when China placed an oil rig in waters near the Paracel Islands, which Vietnam claims, Hanoi has repeatedly asked Washington for the freedom to buy American lethal weapons. The United States partly relaxed the ban two years ago, allowing the purchase of nonlethal equipment for maritime defense.

China’s reaction to the decision on Monday was subdued.

“The arms embargo is a product of the Cold War and should never have existed,” Hua Chunying, a spokeswoman for the Foreign Ministry, said during a news briefing in Beijing. “We welcome normal relations between Vietnam and the United States.”

But beneath the polite response are deep concerns in Beijing about the intentions of Vietnam. And Vietnam, while seeking to defend itself from China, is unlikely to completely sever itself from China’s orbit.

In a sign of the complexities of the relationship, the Chinese ambassador to Vietnam, Hong Xiaoyong, met last Thursday with Vietnam’s defense minister, Ngo Xuan Lich, in Hanoi. Both sides pledged to strengthen military ties, said Xinhua, the Chinese news agency.

The lifting of the arms embargo comes at a particularly sensitive time for China. The government is running a high-pitched diplomatic campaign criticizing a pending arbitration ruling on the South China Sea. China argues that a United Nations tribunal has no right to make a ruling in the case, which the Philippines brought against China.

Vietnam has loudly backed the right of the Philippines to take its case to the tribunal.

Mr. Obama also announced on Monday that the two sides had formalized an agreement to allow the opening of Fulbright University Vietnam in Ho Chi Minh City, the first independent university in Vietnam in which the government would have no formal role.

The university’s chairman, Bob Kerrey, a former Nebraska senator and a Vietnam veteran who lost part of a leg in combat, said the university could start teaching undergraduates in the autumn of 2017.

Mr. Obama also said that Peace Corps volunteers would be posted to Vietnam for the first time.

Earlier in the morning, Mr. Obama was whisked through Hanoi’s streets for a highly choreographed arrival ceremony at the Presidential Palace. His route was lined with children waving small American and Vietnamese flags.

The president later had dinner with Anthony Bourdain, the host of a CNN program.