Apple (AAPL) has lost an important legal battle in Mexico at a particularly inconvenient time — literally a day before iPhone 5 debuts in the country. A Mexican company called iFone registered its trade name in 2003, four years before iPhone debuted in the United States. As a result, a Mexico City court has now denied Apple’s bid to continue selling iPhones that are called “iPhones.” It is hard to argue that the iPhone isn’t uncomfortably close to iFone, phonetically.

Since iFone is a service company rather than a handset brand, the threat of consumer confusion is somewhat debatable. The Mexican company is a rather prosaic call center software solution expert and it is not immediately clear how many consumers would confuse corporate IT solutions with glamorous gadgets. And iFone’s corporate website has that special 2006 vibe — nary a stitched leather design cue in sight.

It’s too early to tell whether iFone will demand a sales ban on Apple’s iPhones or try to extract a hefty fee for the right to use the trade name. Probably latter; a licensing agreement could well be a nice payday for a boring IT firm.

Ironically enough, Fox News Latino reports that Apple originally sued iFone in Mexico in order to force the Mexican company to stop using its own name. The suit backfired dramatically, as iFone was able to prove its trade name predates iPhone by several years.