A wall across the Sahara would probably also involve building through several sovereign nations.
Contractors have completed eight prototypes of President Donald Trump's proposed border wall with Mexico. Trump also brushed off the suggestion that the size of the Sahara would make it a hard task, by saying: "The Sahara border can't be bigger than our border with Mexico".
The wall was one of Mr Trump's dominant campaign promises, but few believe building it along 2,000 miles of the USA border is realistic or feasible.
The Spaniard did not reveal when the commander-in-chief floated the plan, although other sources said it was in June when he flew to the States during the White House visit of Spain's King and Queen.
Trump met with Borrell when the Spanish king and queen visited the USA this summer.
His comments were widely reported in Spanish media.
The length of the US-Mexico border is less than 2,000 miles compared to the Sahara that runs for around 3,000 miles.
A foreign ministry spokesperson confirmed Borrell's comments to the Guardian, but declined to comment further.
Since the start of 2018, more than 38,000 migrants have arrived in Spain, mostly by sea.