Mark Zuckerberg took aim at Donald Trump in his keynote speech at Facebook's F8 developer conference on Tuesday.

Without naming the GOP frontrunner, the Facebook CEO slammed Trump's plan to build a wall between the U.S. and Mexico.

His thinly-veiled dig came during a speech about freedom of expression and immigration as he warned America risks cutting itself off from the world.

'As I look around and I travel around the world, I'm starting to see people and nations turning inward, against this idea of a connected world and a global community,' he said.

'I hear fearful voices calling for building walls and distancing people they label as others. For blocking free expression, for slowing immigration, reducing trade, and in some cases around the world even cutting access to the internet.'

SCROLL DOWN FOR VIDEO

Without naming the GOP frontrunner, Facebook CEO Mark Zuckerberg slammed Donald Trump's plan to build a wall between the U.S. and Mexico in his pro-immigration speech on Tuesday (pictured) at the F8 conference

Immigration, he told the audience in San Francisco's Fort Mason center, fuels economic success.

'Instead of building walls we can help build bridges,' he added as he mentioned Facebook's plans to launch a plane that will provide internet signal to disconnected parts of the world.

He concluded: 'It takes courage to choose hope over fear. People will always call you naive but it’s this hope and this optimism that's behind every important step forward.'

Zuckerberg has not given his backing to any specific candidate, but this is not the first time he has hit out at Donald Trump.

In February, the president of Zuckerberg's pro-immigration lobby group FWD.us, Todd Sculte, described Trump's policies and 'horrible and fatal' in an interview with CNBC ahead of the Iowa caucus.

'For the first time, a major party [is] putting forth people who are saying they are going to round up and deport 11.5 million people; they’re going to eliminate high-skilled immigration,' Schulte said.

'And look, that may get you a win or second place in the Iowa caucuses. That is just a horrible and fatal position in a general election.'

He later tweeted: 'Trump’s a hack, runs for [sic] policy specifics. Be it immigration, trade, foreign policy – answer is always he’s a strongman, others are weak.

'On immigration, he wandered into something awful that credentialed past apostasies as ok – rounding up every last undocumented immigrant.'

When Zuckerberg launched FWD.us, he wrote an editorial calling for more H1B visas, which are issued to workers.

Zuckerberg said of Trump: 'I hear fearful voices calling for building walls'. His words come days before Trump (pictured in Albany on Monday) is expected to easily win the Republican primary in New York

'Instead of building walls we can help build bridges,' said Zuckerberg on Tuesday (pictured running in China)

'To lead the world in this new economy, we need the most talented and hardest-working people,' he wrote.

'We need to train and attract the best. We need those middle-school students to be tomorrow’s leaders.

'Given all this, why do we kick out the more than 40% of math and science graduate students who are not US citizens after educating them?

'Why do we offer so few H1B visas for talented specialists that the supply runs out within days of becoming available each year, even though we know each of these jobs will create two or three more American jobs in return?'

According to FEC records read by Inc, Zuckerberg received a reimbursement from Marco Rubio's campaign after the Florida senator dropped out of the race.