President Donald Trump advised Spain to build a wall stretching across the Sahara desert in order to stop the flow of migrants crossing the Mediterranean Sea, the country's foreign minister said this week.

A video clip shared on Spanish media shows Foreign Minister Josep Borrell bring up Trump's remark while discussing Spain's immigration issues at a lunch symposium in Madrid Tuesday.

"Closing the ports is not a solution, as neither is it a solution to build a wall across the Sahara desert, as President Trump recently suggested," he said. "Do you know how big the Sahara is?"

Borrell said that Trump responded to Spanish officials' skepticism about the practicability of such a wall by saying, "The border with the Sahara can't be bigger than ours with Mexico," according to Spanish newspaper El País.

The Spanish officials reportedly explained that the Sahara is, in fact, much larger. The Sahara desert stretches about 3,000 miles across northern Africa, making is about 1,000 miles longer than the U.S. border with Mexico.

An additional problem with Trump's suggestion of applying his U.S. immigration solution to Spain is that Spain is separated from the continent of Africa by the Mediterranean Sea and does not physically border any African nations with the exception of two enclaves in northern Africa. The suggested wall would have to be constructed across a number of foreign nations.

El País reported that Borrell did not specify when Trump made the remark, but diplomatic sources told the paper the exchange occurred when Borrell accompanied the Spanish royal family to the White House in June.

According to El País, later in the discussion, Borrell said, "European societies are not structured to absorb more than a certain percentage of migrants, especially if they are Muslims."

Spain has become a primary destination for migrants crossing the Mediterranean with more than 33,600, or 43 percent, of "all irregular arrivals" from the sea landing on Spanish shores in 2018, according to the International Organization on Migration.

President Trump to African leaders:'I have so many friends going to your countries'

More:President Trump's 'Nambia' remarks at U.N. prompt Twitter scorn