The European Union’s highest court on Tuesday struck down a trans-Atlantic pact used by thousands of companies to transfer Europeans’ personal information to the U.S., throwing into jeopardy data traffic that underpins the world’s largest trading relationship.

In a victory for privacy advocates, the European Court of Justice ruled that national regulators in the EU can override the 15-year-old “Safe Harbor” pact used by about 4,500 companies, including Apple Inc. and Alphabet Inc.’s Google, because it violates the privacy...