Nokia and HTC announced today that they've settled all of the pending patent litigation between the two firms and will cross-license each other's patents going forward. Both firms make some of the best hardware in the smartphone market but struggle in the face of ever-growing dominance by Samsung.

Many are positioning this agreement as a model for other mobile-industry players to follow, but it came only after a German court handed Nokia a decisive legal victory that would have required HTC to redesign some of its handsets. Under terms of the deal, which Credit Suisse has called a "benchmark win" for Nokia, HTC will pay an undisclosed sum to Nokia.

Related: "Nokia Files Sweeping Patent-Infringement Lawsuits Against HTC, RIM, and ViewSonic"

"We are very pleased to have reached a settlement and collaboration agreement with HTC, which is a long-standing licensee for Nokia's standards essential patents," Paul Melin, Nokia's chief intellectual property officer, said in a prepared statement. "This agreement validates Nokia's implementation patents and enables us to focus on further licensing opportunities."

"Nokia has one of the most preeminent patent portfolios in the industry," HTC General Counsel Grace Lei agreed. "As an industry pioneer in smartphones with a strong patent portfolio, HTC is pleased to come to this agreement, which will enable us to stay focused on innovation for consumers."

The case dates back to a 2012 allegation that HTC infringed on more than 50 Nokia patents and was just one of the many patent lawsuits that have swept the mobile industry over the past few years. The biggest, involving Samsung and Apple, could actually head to trial this year. But both firms have agreed to try mediation one last time. Those meetings, which will involve the CEOs of both firms, are set for later this month.

As for Nokia and HTC, both firms continue to struggle. Nokia accounts for about 4 percent of all smartphones sold worldwide and expects to sell its handset and related businesses to Microsoft as soon as this quarter. And HTC—which has fallen from 10 percent of the market to just 2 percent over the past two years—has said that it will now focus on entry-level and mid-tier smartphones rather than expensive flops like the HTC One. The firm hopes to return to profitability in 2014.

Related: "Move to Windows Phone with Free HTC and Nokia Phones from Verizon"