BRUSSELS (Reuters) - The European Union’s top court ruled on Tuesday that Gibraltar and the United Kingdom can be treated as a single EU member for certain aspects of EU law, a finding that could complicate the territory’s hopes of winning a special status after Brexit.

The European Court of Justice was asked to provide a ruling in relation to a dispute between the Gibraltar Betting and Gaming Association and the UK tax authorities after a British law in 2014 introduced a duty to be paid by gambling companies for offshore bets placed by British consumers.

The gambling association, representing Gibraltar-based gambling operators, had argued that the law change resulted in double taxation and infringed EU law guaranteeing the freedom to provide services across the bloc.

A UK court asked the EU court whether Gibraltar and Britain were to be treated as a single EU member state for which the EU law would not apply.

The court said that Gibraltar did not form part of the United Kingdom, but that trade between the two was not the same as trade between separate EU member states given their connections.

“It follows that the provision of services by operators established in Gibraltar to persons established in the United Kingdom constitutes, under EU law, a situation confined in all respects within a single Member State,” the court said.

The court said its conclusion should not be understood as undermining the separate and distinct status of Gibraltar.

The future of Gibraltar, a rocky British enclave on Spain’s southern tip, is set to be a major point of contention in the British EU exit talks with the EU offering Spain a right of veto over the relationship between Gibraltar and the EU.

Spain claims sovereignty over “the Rock”.