Nokia and HTC <2498.TW> won a key ruling by the European Patent Office that a patent used by German firm IPCom in legal battles against the two mobile phonemakers was invalid in its current form.

Wednesday's ruling was a rare spot of good news for Nokia which is struggling with dwindling sales and credit rating downgrades in recent weeks. Nokia said it meant it could continue selling products in Germany.

IPCom said it would immediately appeal against the ruling and that its patent 100A, which standardises a cellphone's first connection to a network, was valid until a final decision on the appeal.

Today's judgment does not impact the successful rulings regarding infringement proceeding against Nokia and HTC in Germany and UK, it said.

IPCom acquired Bosch's mobile telephony patent portfolio, which was created between the mid-1980s and 2000 and includes about 160 patent families worldwide.

Those patents, including 100A, include some key technologies for the wireless industry.

Several top phone makers have signed a licensing deal with IPCom, but HTC and Nokia have challenged IPCom's patents in courts across Europe.

IPCom needs to recognize its position and end its unrealistic demands, Paul Melin, vice president, Intellectual Property at Nokia, said in a statement.

(Reporting by Tarmo Virki; Keiron Henderso)