Alphabet Inc.’s Google and Starbucks Corp. scored legal victories against European Union regulators Tuesday, in court rulings that restrict the reach of the bloc’s privacy orders and deal a blow to its competition czar as she prepares to expand her regulatory powers.

The European Court of Justice ruled that Google doesn’t generally have to apply the EU’s “right to be forgotten” to versions of its search engine accessed outside the bloc’s borders, though judges left the door open for European regulators to order it to do so in specific cases.

Established in 2014 by another court decision, the right allows a person to request that search engines remove links including personal information from the results of web searches for his or her own name.

The decision from the EU’s top court is a victory for Google and the companies and free-speech advocates that supported it, because it avoids the creation of a general obligation. For four years, Google has been fighting an order from France’s privacy regulator to apply the EU principle globally.

Over that period, Google and its backers have argued that expanding the right to be forgotten would infringe on other nations’ sovereignty and encourage dictators and tyrants to assert control over content published beyond their countries’ borders.