The surprise breakthrough follows months of contentious talks over $350 billion in investments Seoul has pledged to America.