The Duke and Duchess of Sussex visited the dressing rooms of the New York Yankees and the Boston Red Sox, before the two teams faced each other in London.
Both teams presented the couple with gifts for their son Archie, who was born in May.
Prince Harry had been scheduled to attend the match, but the appearance by Meghan was unexpected.
The pair were joined by members of the Invictus Games Foundation on the field for a ceremonial first pitch.
The match is the first regular-season, Major League Baseball game to be played in Europe.