President Obama spent Friday afternoon in Seoul paying homage to American military service, as well as to the loss suffered by South Koreans in the April 16 sinking of the Sewol ferry.

Meeting with South Korean President Park Geun-hye, Obama first proposed holding a moment of silence to honor the men and women who lost their lives in this month’s accident. Then he offered Park an American flag as a sign of Americans’ sympathy for the loss of “so many young people, students who represented the vitality and the future of this nation.”

The flag flew over the White House the same day the ferry capsized off South Korea’s southwestern coast; Obama noted that the gesture was akin to when an American service member has died, and the government presents “a flag in their honor to their loved ones.”

“The Korean people draw great strength and courage from your kindness,” Park responded, adding later, “Just as the American people were able to rally together in the wake of the September 11 terrorist attacks, so, too, I am sure that Korean people will, in fact, pull through this moment of crisis and be able to achieve the renewal of the Republic of Korea.”

Obama also brought a magnolia tree from the White House lawn to give to the Danwon High School, whose students and teachers accounted for the majority of the ferry accident’s victims.

A few hours before, Obama had participated in a different, though equally somber, ceremony, as he laid a wreath in honor of those Americans who died in the Korean War at the National War Memorial adjacent to the Yongsan U.S. Army garrison. Walking through the arched granite gallery, with the names of the American dead etched on copper panels hung on the walls, the president put a wreath with red and white ribbons beneath one of the plaques while an Army bugler played taps.

Shortly before laying the wreath, Obama addressed a group of 20 participants in a U.S. naturalization ceremony and used the opportunity to make the case for adopting comprehensive immigration reform.

Telling the group gathered on stage that he was congratulating them on “becoming the newest citizens of the world’s oldest constitutional democracy,” he noted that they hailed from 14 countries and came to this moment through different paths.

”Thirteen of you made the profound decision to put on the uniform of a country that was not yet fully your own,” he remarked from the stage. “Seven of you married an American soldier — and as a military spouse, that means you’ve been serving our country, too.”

“If there’s anything that this should teach us, it is that America is strengthened by our immigrants,” Obama said. “What makes us Americans is something more than just the circumstances of birth, what we look like, what God we worship, but rather it is a joyful spirit of citizenship.”

“And that means, moving forward, we’ve got to fix our broken immigration system and pass common-sense immigration reform,” he argued.

In a separate event connected to the Korean War, Obama took part in a formal ceremony to return nine ancient seals that had been taken as mementos by a U.S. Marine during the conflict. “I just want to let the Korean people know that they are back where they belong,” he said.

While most of Friday’s events were connected to mourning, the president also visited a popular tourist site, Gyeongbok Palace. The compound of pagoda-like buildings featured an elaborate throne room as well as a moat and bridge.

Obama’s arrival in Seoul came just after the White House declared that it had made significant progress in trade negotiations with Japan. A senior administration official described the development as a “breakthrough” in the countries’ effort to advance a broader accord known as the Trans-Pacific Partnership (TPP) initiative.

Ben Rhodes, deputy national security adviser for strategic communications, told reporters that the two nations “have identified a path forward to deal with our bilateral issues in the negotiation.” He said the progress will “also give momentum for the regional negotiation, given how much the bilateral issues between the United States and Japan have been a focal point for moving the agreement forward.”

During their joint news conference, Park said she was optimistic that the regional trade deal would help foster ties between South Korea and the United States, even though South Korea has not yet joined the group. “TPP will enable both of our countries to expand our cooperation in the future,” she said.