Donald Trump has once again taken to Twitter in the wake of the recent terrorism in Barcelona, attacking the US courts and Democrats for undermining national security.

He tweeted: "Radical Islamic Terrorism must be stopped by whatever means necessary" in light of the terrorism in Spain that has resulted in at least 14 deaths and scores of injuries after a van drove into crowds in on the busy Las Ramblas street.

Mr Trump appears to be referring to his travel ban, which placed a hold on people from six Muslim-majority countries from entering the US.

The so-called 'Muslim ban' was upheld by the US Supreme Court on 29 June 2017. It restricted travel from Iran, Libya, Somalia, Sudan, Syria and Yemen for 90 days, and limits all refugee admissions for 120 days.

Mr Trump signed the executive order his first week in office and had repeatedly claimed on the campaign trail such a ban was necessary "until we know what's going on" with Muslim travellers from these countries and their supposed, possible ties with terror groups.

"The courts must give us back our protective rights," he tweeted, furthering his rhetoric that the ban is to protect the American people from extremists and acts of terror like what took place in Barcelona.

For its part, Spain's anti-immigration right wing has stayed on the "fringe" and not taken the hold that it has in the UK and France, NPR reported.

The country's history of dictatorship has not pushed economically downtrodden Spaniards to take their frustrations out on immigrants and flock to the right wing or fostered anti-Islam sentiment despite thousands of refugees and immigrants in recent years.

The City Hall in Madrid had a "Refugees Welcome" banner.

He blamed "obstructionist Democrats" for "using" the courts to delay a full ruling and implementation of the ban. Many Democrats opposed the ban because it singled out one particular religious group and the administration's lack of legal reasoning for the decision to lump together Muslims and Islamist extemists.

The highest court in the country left some lower court provisions in place, which the State department officially adopted as policy. Per US District Court Judge Derrick Watson in Hawaii, refugees formally working with resettlement agencies are allowed to enter the country.

Mr Watson also ruled to expand the types of family relationships people can use to enter the US to include grandparents, grandchildren, aunts, uncles, cousins and in-laws.