NEW YORK (AP) — Shares of Williams Cos. hit an all-time high Monday after the pipeline operator agreed to buy a part of natural gas processor Access Midstream Partners LP for nearly $6 billion.

Williams is buying all of Global Infrastructure Partners interest in Access. The deal, which is expected to close in the third quarter, will give Williams a 50 percent ownership.

Access, based in Oklahoma City, gathers and processes natural gas. Williams, based in Tulsa, Oklahoma, operates natural gas pipelines around the country.

Williams wants to merge Acess with its energy infrastructure limited partnership Williams Partners LP after the acquisition closes. If that happens, Williams said the master limited partnership will be one of the largest in the industry, with 2015 earnings before interest, taxes, depreciation, and amortization expected the be $5 billion

Raymond James analyst Kevin Smith said the deal will give Williams access to several shale oil formations. He reiterated his "Outperform" rating on the stock and increased its target price to $61.

Williams Cos. is also increasing its quarterly dividend 32 percent to 56 cents per share after the deal closes.

Shares of Williams Cos. rose more than 22 percent to reach $59.68 earlier. Units of Access added 24 cents to $65.60 and Williams Partners LP rose $3.63, or 6.9 percent, to $56.55.