Canadian patent licensing company Mosaid Technologies (MSD.TO: Quote) said late on Thursday that it agreed to be bought by U.S.-based private equity firm Sterling Partners for C$590 million ($596 million), which trumped a hostile bid from rival Wi-Lan Inc (WIN.TO:Quote) for C$532 million.

The all-cash offer of C$46 per share came more than two months after Mosaid rejected an unsolicited C$38 a share bid from Wi-Lan, and embarked on a search for a higher bid.

Last week Wi-Lan raised its bid to C$42 a share and said it was its final offer.

Mosaid shares closed up 0.51 percent at C$43.42/share in Toronto on Thursday, before the bid was announced.

On the surface, C$46 seems like a good counter-offer for Mosaid, a good friendly bid for Mosaid, said Sameet Kanade, an analyst at Northern Securities.

Kanade said he expected shareholders would approve the deal, and doubted Wi-Lan would raise its hostile offer. Mosaid has agreed to pay Sterling a break-up fee of C$22 million if the deal is not completed.

Wi-Lan declined comment on Thursday.

Wi-Lan and Mosaid make money by developing and licensing intellectual property for the communications and consumer electronics markets, where tech majors pay increasingly huge sums for patents to use as weapons in litigation and cross-licensing.

In early September, Mosaid said it had bought some 2,000 Nokia patents that could generate revenue in excess of all revenue the company had made in its previous 35 years in business.

While Mosaid said the deal was in the works for months and not an attempt to block Wi-Lan's original bid, it complicated dealings between the two Ottawa-based rivals, who disagreed about value of the new patents.

Mosaid gets much of its revenue from licensing deals for memory and semiconductor technology and says anyone using Wi-Fi needs one of its licenses.

In recent weeks, it said it was in talks with several other parties and asked shareholders not to tender to the Wi-Lan bid, which expires on November 1.

The deal with Sterling needs the support of two-thirds of Mosaid shareholders in a vote to be held in late December or early January.

The Board of Directors of Mosaid ... has unanimously determined that Sterling's offer is fair to Mosaid shareholders, the company said in a statement.

Sterling, with offices in Chicago, Baltimore, and Miami, has some $5 billion in assets under management.

($1= $0.99 Canadian)

(Additional reporting by Euan Rocha; editing by Gunna Dickson)