Mobile provider Vodafone has failed to break up a deal giving rival T-Mobile the exclusive rights to distribute Apple's iPhone in Germany.
Vodafone wanted iPhone users to be able to choose between networks
A German court overturned a temporary injunction it granted two weeks ago, which forced T-Mobile to sell iPhones that were not tied to a single network.
Vodafone objected to the exclusivity agreement and said customers should be able to choose between networks.
Apple has similar licensing agreements with O2 in the UK and AT&T in the US.
There has been much speculation about the details of the deals between Apple and the mobile providers, who are reported to be paying the US computer firm anything from 10% to 30% of their iPhone revenues.
"We are pleased with the outcome," said T-Mobile spokesman Rene Bresken.
In the two weeks since the temporary injunction was granted, T-Mobile sold the handsets without a network contract for 999 euros ($1,477; £719).
That price was a significant premium to the 399 euro cost for a phone with a two year T-Mobile contract.
T-Mobile has now promised that at the end of the two year contracts it will unlock the phones at no charge.
Despite the best efforts of Apple and the phone companies to tie consumers to one provider, programmes have been circulating online that allow users to unlock their iPhone so that it can be used on any network.
Apple in turn has warned that hacking into the phone's software could render the phones "permanently inoperable" when it releases software updates.
Apple still faces two lawsuits in the US from people alleging that preventing users unlocking their iPhones is an unreasonable restriction of consumer choice.
It has sold more than 1.4 million iPhones so far and hopes to sell 10 million in 2008.