Corporate raider Carl Icahn has reached an agreement with the management of CVR Energy under which the company will drop its poison pill provision, clearing the way for a potential $2.26 billion bid for the Sugar Land, Texas-based oil refiner.

Icahn first began circling the CVR wagon in January, after his affiliates picked up a 14.5 percent stake in the company for about $144.7 million. The purchase also made Icahn the company’s largest shareholder, and CVR and its lawyers from Wachtell, Lipton, Rosen & Katz—who have plenty of experience battling the renowned shareholder activist—adopted antitakeover measures.

After months of wrangling between the parties, CVR announced Thursday that it had entered into a transaction agreement with Icahn that would allow him to complete a tender offer for the company should he gain the support of a majority of its shareholders. (While Icahn has already said publicly that 55 percent of CVR’s shareholders support him and his bid, he was unable to buy more of the company’s stock until CVR removed its poison pill.)

Wachtell corporate partners Andrew Brownstein and Benjamin Roth are advising CVR, along with antitrust partner Nelson Fitts, executive compensation and benefits partner Michael Segal, restructuring and finance partner Eric Rosof, and tax partner Jodi Schwartz.

CVR’s general counsel is Edmund Gross. Last year the company, which specializes in oil refining and the production of petroleum-based products, turned to Fried, Frank, Harris, Shriver & Jacobson for counsel on its $625 million acquisition of Gary-Williams Energy

CVR securities filings show that Keith Schaitkin, general counsel of Icahn Enterprises, is advising Icahn on the potential transaction. The president of Icahn Enterprises, Daniel Ninivaggi, is a former corporate partner at Winston & Strawn.

If he proves successful in gaining control of CVR, Icahn plans to put it up for sale. Reuters reports that Icahn’s bid includes a “contingent value right” that would enable CVR shareholders to receive additional cash payments if he sells the company within nine months.