Google Chief Executive Sundar Pichai criticized President Donald Trump’s immigration order in an email to staff late Friday, saying the U.S. ban on foreign nationals from seven countries affects at least 187 Google employees.

“We’re upset about the impact of this order and any proposals that could impose restrictions on Googlers and their families, or that could create barriers to bringing great talent to the US,” Mr. Pichai said in the email, according to a copy reviewed by The Wall Street Journal. “It’s painful to see the personal cost of this executive order on our colleagues.”

Mr. Trump on Friday signed an executive order that, for at least 90 days, bans people from seven Muslim-majority nations—Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen—from entering the U.S. The order also indefinitely bans Syrian refugees from the U.S. and suspends the broader refugee program. Mr. Trump said the order was to keep out “radical Islamic terrorists.”

Humans-rights advocates criticized the move as religious persecution. Now two leading tech executives are speaking out against the order.

Earlier on Friday, Facebook Inc. CEO Mark Zuckerberg wrote on his Facebook page that he was concerned by the order. “We need to keep this country safe, but we should do that by focusing on people who actually pose a threat,” he wrote.