NEW YORK/OSAKA, Japan (Reuters) - U.S. President Donald Trump, traveling in Asia for a G20 summit, knocked 10 Democratic presidential hopefuls from afar on Thursday for pledging to cover healthcare for immigrants who live in the United States after coming to the country illegally.

U.S. President Donald Trump attends a trilateral meeting with India's Prime Minister Narendra Modi and Japan's Prime Minister Shinzo Abe during the G20 leaders summit in Osaka, Japan, June 28, 2019. REUTERS/Kevin Lamarque

During a televised debate in Miami, a moderator asked the presidential candidates, including former Vice President Joe Biden, Senator Kamala Harris of California and South Bend, Indiana, Mayor Pete Buttigieg, if they would support covering healthcare for illegal immigrants if elected president.

All 10 candidates on the stage raised their hands in the affirmative.

Trump, who has made cracking down on illegal immigration a signature policy of his presidency, pounced via Twitter.

“All Democrats just raised their hands for giving millions of illegal aliens unlimited healthcare. How about taking care of American Citizens first!? That’s the end of that race!” the Republican tweeted.

Trump has promised to build a wall along the U.S. border with Mexico and has declared a national emergency over the number of people crossing into the United States from the south.

Trump is in Osaka, Japan, meeting with world leaders at the Group of 20 summit, but as is customary for him when he travels abroad, he was focused at least in part on goings-on back home.

During a meeting with German Chancellor Angela Merkel, Trump could not help mentioning the Democratic debate.

“You know they have a debate going on,” he said to Merkel. “They had the first debate last night. I don’t know if you saw. It wasn’t very exciting, I can tell you that.”

The debate on Thursday was the second in two nights, bringing together a total of 20 candidates running for the Democratic presidential nomination to take on Trump in the November 2020 election.

Harris appeared to win the debate with a strong performance, including a dramatic exchange in which she challenged Biden over his recent comments about working with segregationist senators.

While there were several clashes between the Democratic candidates over healthcare, immigration and the economy, most also repeatedly blasted Trump.

The Republican president’s campaign team responded by predicting the two debates would prove to be a boost for the White House incumbent.

“The cast of characters may have changed, but the second night’s script was eerily like the first: a two-hour-long infomercial for President Donald J. Trump’s re-election campaign,” spokeswoman Kayleigh McEnany said in a statement.

Trump campaign manager Brad Parscale wrote on Twitter that the Democrats were offering everything from free college to free healthcare, houses, cars, boats, airplanes and ice cream.

“Nobody has to work! Everyone just gets everything for FREE! Amazing!” he tweeted.