Madrid wants to rein in the wealthy northeastern region's unilateral drive for independence from the rest of Spain and the court judgment found that only Spanish diplomacy has the right to engage in “foreign affairs”.
Any attempt by a region to do the same is therefore “unconstitutional and void” as it could lead to “confusion,” given foreign policy is the unique preserve of Madrid, the court stated.
The court added, nonetheless, that the Catalan regional government may engage in activities abroad if it avoids policy areas where the national government has unique authority.
The Catalan administration created its secretariat early last year as it sought support abroad for a referendum on self-determination, something Madrid rejects out of hand.
The Catalan government has offices in Paris, London, New York, Brussels, Berlin, Vienna, Rome and Lisbon and intends to add more in Croatia, Denmark and Poland.
However, the region of 7.5 million people has not won support for its pro-independence ambitions abroad.
Amid rising tensions, Madrid has spent three years swatting down Catalan attempts to hold a referendum which the region's leaders have called for October.
Madrid says the exercise would be illegal.
Tens of thousands of people, including former Barcelona manager Pep Guardiola, rallied in the city on June 11th in support of the proposed vote.
The separatists want to hold a vote similar to Scotland's 2014 independence referendum – which, unlike their own plan, had the approval of the British government.
Catalans are divided on the independence issue, with 48.5 percent against and 44.3 percent in favour according to latest polls, although some three-quarters back holding a referendum on the issue.