The maker of the Blackberry e-mail device has reached a $612.5m (£349m) settlement to end a dispute that could have closed the service in the US.
Blackberry devices are used by three million people in the US
Canadian firm Research In Motion (RIM) said on Friday that the deal with American patent-holding business NTP was a "full and final settlement".
NTP, which had claimed RIM stole its technology, had tried to get the Blackberry service shut in the US.
The portable device has three million American users.
"All terms of the agreement have been finalised and the litigation against RIM has been dismissed by a court order this afternoon," said RIM.
"The agreement eliminates the need for any further court proceedings or decisions relating to damages or injunctive relief.
RIM's headquarters in Canada
"NTP grants RIM an unfettered right to continue its business, including its Blackberry-related business."
The settlement brings to end four years of legal dispute in the US between the two companies.
RIM said it had already put aside $450m for a possible settlement with NTP, and that the additional $162.5m would be recorded in its next quarterly report due in April.
The overall $612.5m settlement compares to the firm's total cash reserves of $1.8bn.
Last year the firms agreed a tentative settlement, but the agreement subsequently collapsed, taking the case all the way to the US Supreme Court.
Earlier this month, the US government asked a federal judge to hold off from a possible shutdown of the Blackberry service, because of the system's popularity among key government employees.
RIM had argued that a shutdown of Blackberry services would impair critical public services.
The Blackberry now has 4.3 million global users.