Today, that legal feud has come to an abrupt end with a surprising outcome. Apple has agreed to license patents from Nokia. Apple will now make a one-time payment to Nokia and then be subject to ongoing royalties for “the term of the agreement.”

Both companies are keeping the terms of that agreement confidential, but what this means is Apple now most likely pays Nokia a sum of money for every iPhone and iPad sold. That one-time payment will no doubt cover previous sales of millions of smartphones and tablets and could therefore be quite large.

As to what the licensing covers, the original complaint and lawsuit filed by Nokia covered GSM, UMTS, and LAN (WLAN) patents. Further lawsuits also brought into play enhanced speech and data transmission patents, the use of positioning data in apps, and antenna configuration designs.

The decision will prove embarrassing for Apple who now has to pay a company running the rival Windows Phone 7 operating system a license fee. There’s also a suspicion Nokia may be acquired by Microsoft in the near future meaning Microsoft could end up being funded by devices running iOS as well as the license fee it already receives from HTC on every Android smartphone it ships.

Everyone knows that Nokia is struggling otherwise it would not have done a deal with Microsoft. Even so, the company has a very strong patent portfolio and is keen to take advantage of it. This win could present Nokia with a substantial new revenue stream from one of its biggest rivals.

It’s unfortunate for us, but understandable for both companies, that the terms of the agreement are not being made public. We have to assume, though, that Apple is paying a royalty on every phone and tablet it ships. If that’s anywhere near the $5 HTC pays Microsoft on every phone, Nokia has just secured millions for itself.

How long this agreement lasts, and whether it extends to future Apple products, depends on whether Apple can design around the infringing technology in the future. If they center on data transmission though, that’s going to be very tough to avoid.

This may also offer us an insight into why Microsoft wants to buy Nokia: it’s all about those patents. Now Apple is a customer of Nokia, I bet Ballmer is chomping at the bit to take Nokia under its wing for a few billion dollars.