President Donald Trump with Spanish Prime Minister Mariano Rajoy

US President Donald Trump said it would be "foolish" for Catalans to try to leave Spain, urging the country to remain united ahead of a banned independence referendum Sunday.

"I really think the people of Catalonia would stay with Spain," Trump said as he offered support to visiting Spanish Prime Minister Mariano Rajoy at the White House Tuesday.

"I think it would be foolish not to. You're talking about staying with a truly great, beautiful and very historic country."