The war in Vietnam could have gone nuclear, if the top US military commander in the Southeast Asian country had had his way, according to a startling report.

The New York Times, citing recently declassified documents, said Saturday that in 1968, Gen. William Westmoreland activated a plan to move nukes to Vietnam if it looked like the US and its allies would lose the battle for the base at Khe Sahn. But then-President Lyndon Johnson vetoed the plan, fearing China would join the war on the side of the North Vietnamese — and ordered the nukes turned back, according to the Times.

The plan to have the weapons readily available on short notice had been approved by the American commander in the Pacific, Adm. Ulysses S. Grant Sharp Jr.

The Civil War general and later president married Sharp’s great-aunt.

The Times said the president was told of the plan by Tom Johnson, his special assistant.

The two Johnsons were not related.

The president “had great admiration for General Westmoreland, but he didn’t want his generals to run the war,” Tom Johnson said.

The story is included in a coming book, “Presidents of War,” by historian Michael Beschloss.

Khe Sahn was successfully defended, but was dismantled to prevent similar battles.