T-Mobile can sell Apple’s sought-after iPhone exclusively locked to its own service, a German court ruled Tuesday, reversing an injunction last month requiring the company to sell an unlocked version in Europe’s biggest economy.

The Hamburg District Court said Tuesday that T-Mobile, part of Deutsche Telekom AG, could indeed sell the phone, coupled with a two-year contract, that could not be used on networks provided by rival wireless companies.