SEOUL, South Korea — The last time his liberal political party was in power, Moon Jae-in saw his boss at the time, Roh Moo-hyun, then South Korea’s president, walk across the Demilitarized Zone into North Korea for a summit meeting that resulted in a peace declaration and promises of abundant aid.

He then saw those deals discarded a year later, in 2008, by a newly elected president who sought closer ties with President George W. Bush, who had branded the North part of an “axis of evil.”

Now, as president of South Korea, Mr. Moon is keen not to repeat past failures as he stakes his own political career on brokering a deal between the unpredictable leaders of the United States, his nation’s protector, and North Korea, long its mortal foe.

As chief of staff during the Roh administration, from 2003 to 2008, Mr. Moon did not participate in the negotiations with the North, led at the time by Kim Jong-il, the father of the current leader, or join Mr. Roh’s overland visit to Pyongyang, the North Korean capital. But he did help Mr. Roh organize those talks, held in October 2007.