PALO ALTO — Ending an infringement spat first disclosed in November as Twitter worked toward its massive initial public offering, the company announced Friday that it had acquired more than 900 patents from IBM and entered into a cross-licensing agreement. Terms weren’t disclosed.

IBM had accused Twitter of infringing on “at least three” patents, but invited the company to come to the table for discussions rather than pursue the matter in court. The deal marks Twitter’s first pure patent acquisition, and will prove key to the company’s defense strategy as it wards off infringement attacks going forward.

Mark Lemley, director of Stanford Law School’s Program in Law, Science and Technology, told The Recorder at that time it was not uncommon for companies to get hit with an infringement notice ahead of a major capital raise. Facebook, for example, found itself in a similar situation ahead of its 2012 IPO, when Yahoo fingered it for infringement. It purchased 750 IBM patents at that time as a means to defend itself.

“This acquisition of patents from IBM and licensing agreement provides us with greater intellectual property protection and gives us freedom of action to innovate on behalf of all those who use our service,” Ben Lee, Twitter’s legal director, said in a statement.

In its IPO filings, Twitter said it had just nine patents and 95 pending applications. It also pioneered the Innovator’s Patent Agreement, a novel if somewhat limiting contract that keeps IP in the hands of employees and commits to using patents only as defensive tools. IBM is one of the leading holders of intellectual property in the world, having been granted the most U.S. patents annually for more than two decades, and its patent portfolio brings in about $1 billion a year in licensing revenue.

Contact the reporter at callison@alm.com.