President Trump and the first lady, Melania Trump, were on hand at Joint Base Andrews, Md., early Thursday to welcome three American prisoners freed from North Korea.

JOINT BASE ANDREWS, Md. — Three American prisoners freed from North Korea landed here early Thursday to a personal greeting from President Trump, who traveled to an air base in the middle of the night to meet them.

The return of the prisoners — Kim Dong-chul, Tony Kim and Kim Hak-song — to the United States removed a delicate obstacle as the president prepares to sit down with the North’s leader, Kim Jong-un, for a landmark nuclear summit meeting.

Mr. Trump, frustrated by news reports about a continuing investigation into his presidential campaign’s ties to Russia and faced with criticism from key European allies for withdrawing from the Iran nuclear deal, was eager to celebrate a foreign policy triumph.

Hours earlier, he had mused on Twitter about barring the news media from future events because of displeasure over what he perceived to be negative coverage of his administration. But dozens of journalists assembled at the air base early Thursday, training their cameras on a large American flag that had been strung up on the tarmac as they awaited the arrival of the president and the freed prisoners.

The three American prisoners freed from North Korea, Tony Kim, left, Kim Hak-song and Kim Dong-chul, flanked by Vice President Mike Pence, Mr. and Mrs. Trump, and Secretary of State Mike Pompeo.

The arrival of the men in Maryland capped a whirlwind journey for Secretary of State Mike Pompeo, who secured the men’s release during…