Westlake Chemical Corp. (NYSE: WLK) agreed to acquire Axiall Corp. (NYSE: AXLL)  for about $2.4 billion, burying the hatchet after a five-month takeover contest to become the second largest North American producer of vinyl products used in pipe, siding and decks.

Houston-based Westlake agreed to pay $33 a share in cash, the companies said in a statement Friday. The deal is valued at $3.8 billion including the assumption of debt. The transaction, which is subject to approval by Axiall shareholders and antitrust regulators, is expected to close by the fourth quarter, the companies said.

The acquisition comes amid a record amount of deal making in the chemical industry, led by the merger of DuPont Co. and Dow Chemical Co. in December and Syngenta AG’s February agreement to be acquired by China National Chemical Corp . Axiall expands Westlake’s integration into raw materials such as ethylene and chlorine as well as into finished products made with PVC, a hard plastic used in construction products.

The agreement ends a battle that began in January with Westlake’s $20-a-share unsolicited bid. Axiall rejected that offer, as well as a sweetened bid in March of $1.6 billion, or $23.35 a share in cash and stock.

In the deal announced Friday, Westlake is paying a 9 percent premium over Axiall’s 52-week share average price prior to the initial bid on Jan. 28, Westlake said in a slide presentation. The price represents a 18 percent discount to the Atlanta-based company’s 52-week intraday high.

Axiall surged 25 percent to $32.36 at 10:33 a.m. in New York after reaching as high as $32.52, the intraday peak since July. Westlake, controlled by the billionaire Chao family, climbed 2.5 percent to $46.17.

The Axiall deal sets up Westlake to become North America’s third-largest chlorine and caustic soda producer and second-largest PVC producer. Combined annual revenue was about $7.6 billion for the 12 months through the first quarter, while earnings before interest, taxes, depreciation and amortization were $1.5, the companies said.

“The combined company will have substantial scale advantages, options for ethylene integration and will become the second-largest U.S. PVC producer with 26.2 percent share,” James Sheehan, an Atlanta-based analyst at Suntrust Robinson Humphrey, said in a note Friday.

After Westlake said earlier this year it would try to replace nine of Axiall’s directors with its own nominees, the target company sought other suitors. South Korea’s Lotte Chemical Corp. said this week that it made a bid for Westlake, the terms of which weren’t disclosed. Westlake said it will work with Lotte on an ethylene plant that the South Korean company is building with Axiall in Lake Charles, Louisiana.

Westlake said it won’t try to take over Axiall’s board at the June 17 annual meeting, withdrawing its slate of directors. It expects to reduce annual costs in the combined company by $100 million.

Westlake’s financial advisers are Deutsche Bank AG and Goldman Sachs Group Inc., and its legal counsel is Cleary Gottlieb Steen & Hamilton. Morgan Stanley and Barclays Plc are Axiall’s financial advisers and Jones Day is its legal counsel. Axiall’s board has its own legal counsel, Weil, Gotshal & Manges.