DOVER AIR FORCE BASE, Del. — Vice President Mike Pence traveled to Delaware late Tuesday night to visit with the families of two soldiers killed over the weekend by a roadside bomb in southern Afghanistan.

Standing alongside the deputy secretary of defense, Mr. Pence also witnessed the solemn ritual of transferring the remains of Staff Sgt. Ian P. McLaughlin, 29, of Newport News, Va., and Pfc. Miguel A. Villalon, 21, of Joliet, Ill. The men were killed Saturday while on patrol for the American-led NATO mission known as Resolute Support, the Pentagon said in a statement.

A Taliban spokesman claimed responsibility for the attack.

In a scene that was misty, quiet and somber compared with the raucous Trump campaign rally he had spoken at earlier Tuesday in Wisconsin, Mr. Pence stood with his hand on his heart as a white-gloved crew carried the flag-draped cases from the C-17 aircraft that brought them back to the United States.

“Let them be assured that America will never forget or fail to honor the service and sacrifice” of the two soldiers, Mr. Pence had told the crowd in Milwaukee, which fell momentarily silent.