Image caption HTC recently launched new phones that run on Windows software

Apple and Taiwanese phonemaker HTC have settled all their outstanding disputes over patents, ending a fight that began in March 2010.

The two firms also signed a 10-year licence agreement that will extend to current and future patents held by one another.

HTC competes with Apple, Samsung and others in phones and tablets.

Apple has been embroiled in a series of "patent wars" with phone makers and with arch-rival Google.

Unlike its rivals, HTC's sales have been in decline since the second half of 2011, despite having become a major global phone company by aligning itself to Google's Android platform.

The firm has upgraded its HTC One flagship phone and introduced two new models running Microsoft's Windows Phone 8 software.

"HTC is pleased to have resolved its dispute with Apple, so HTC can focus on innovation instead of litigation," said Peter Chou, the head of HTC.

The firm said recently it expects sales will be lower than had been expected at the end of the year as the Taiwanese smartphone maker has been finding it hard to emulate the success of its rivals.

HTC and Apple were fighting more than 20 cases in the world, according to the AFP news agency.

Apple won an order almost a year ago from the US International Trade Commission, which issued a "limited exclusion order" directing that HTC stop bringing offending smartphones into the US from April.

And in May, the US mobile carrier Sprint had to delay the introduction of a smartphone using Google's Android operating system after the devices were blocked by US customs due to an Apple complaint.

Ongoing cases

Apple and its rivals have been suing and countersuing for the past several years, accusing each other of copying designs and ideas in the lucrative smartphone space.

Apple and Samsung, for example, have filed legal cases against each other in more than 10 countries, each accusing the other of violating its patents.

A California court earlier this year awarded Apple $1.05bn (£652m) in damages against Samsung, after ruling several of its software and design technologies had been infringed, but the Korean firm is calling for a retrial.

And last week, a US judge dismissed Apple's case in which it alleged that Google's Motorola unit was seeking excessive royalty payments for patents.