WASHINGTON — President Trump will get together with the leader of North Korea, Kim Jong-un, this month in Hanoi, choosing the capital of a communist nation for a high-stakes summit meeting intended to eliminate a potential nuclear threat, the White House said on Friday.

“My representatives have just left North Korea after a very productive meeting and an agreed upon time and date for the second Summit with Kim Jong Un,” Mr. Trump said on Twitter. “It will take place in Hanoi, Vietnam, on February 27 & 28. I look forward to seeing Chairman Kim & advancing the cause of peace!”

Mr. Trump revealed in his State of the Union address this week that the meeting would be in Vietnam but did not disclose the city. The United States had explored Danang, a coastal city where American troops arrived in 1965 for a war that would scar a generation, but the North Koreans were reported to prefer Hanoi.

Mr. Trump and his aides have cited Vietnam as an example of a communist nation that emerged from international isolation to develop a dynamic economy. Mr. Trump has sought to persuade Mr. Kim that giving up his nuclear weapons would enable him to transform his impoverished land into a thriving country.