China claims most of the waterway – believed to hold vast oil and gas deposits and through which $5 trillion in trade passes annually – and has built up islands and military installations in the sea.

According to Ngo Xuan Lich, Vietnam, Taiwan, the Philippines, Malaysia and Brunei also have claims in the waterway. Vietnam and US defence officials have submitted requests for the aircraft carrier to visit.

Mattis thanked Vietnam for the ‘increasing partnership with our aircraft carrier coming into Danang in March.’

Though smaller US ships have docked on Vietnamese shores, Mattis spokesperson Jeff Davis confirmed it will be the first time a US aircraft carrier will port in Vietnam.

US aircraft carriers neared Vietnamese shores during the Vietnam War which ended in 1975, but this will be the first time for a carrier to port in the country, officials from the US DoD said.

Mattis said earlier that freedom of navigation in the sea was crucial for fast-growing Vietnam.

Mattis continued: ‘Freedom of navigation and access in the South China Sea will be critical to them economically, of course, and their security efforts.’

Military ties between the former foes have improved in recent years. In 2016, former US president Barack Obama, on a visit to the country, lifted an arms embargo in place since the end of the Vietnam War.

Vietnam's Defence Minister Ngo Xuan Lich visited Mattis in August 2017, part of Hanoi's campaign to keep Washington close under US president Donald Trump.

Mattis, who is in Vietnam for the first time, heads back to the US on 26 January, capping a five-day trip to the region that included a military performance in Indonesia involving snake sacrifice and flaming bricks.