Canada's BlackBerry said on Friday that U.S. chipmaker Qualcomm has agreed to pay the software maker $940 million, including interest and legal fees, to settle a royalty dispute.

Qualcomm had said in April that it would have to refund BlackBerry $814.9 million, plus interest and attorneys' fees, in an arbitration over royalties for certain past sales.

The dispute between the two companies started in 2016 following Qualcomm's agreement to cap certain royalties applied to payments made by BlackBerry under a licensing deal.

Qualcomm is expected to pay the final amount on or before May 31, BlackBerry said on Friday.