HANOI, Vietnam — U.S. Defense Secretary Mark Esper on Wednesday accused China of using coercion and intimidation against smaller Asian nations to impose its will in the South China Sea. He urged Vietnam and others in the region to push back.

"We will not accept attempts to assert unlawful maritime claims at the expense of law-abiding nations," Esper said in a speech to the Diplomatic Academy of Vietnam, a government university.

Vietnam is one of the region's most vocal critics of China's sweeping territorial claims in the South China Sea and has accused Beijing of encroaching into its waters.

"The United States firmly opposes intimidation by any claimant to assert its territorial or maritime claims, and we call for an end to the bullying and unlawful activities," Esper said.

Later, in remarks at Vietnam's Communist Party headquarters, Esper said, "We strongly oppose violations of international law by China and excessive claims in the South China Sea."

As part of a long-term effort to forge closer relations with Vietnam, Esper announced that the U.S. will provide Vietnam's coast guard with a surplus American ship. He said it would be provided next year, but he gave no details on payment or exact timing.

Esper met with several top government officials and paid a visit to the city’s Hoa Lo prison, dubbed the “Hanoi Hilton” by American servicemen held there during the Vietnam War. The late Sen. John McCain was held there after he was shot down in his Navy jet over Hanoi in 1967.