Williams Cos. said Monday it will buy natural gas producer Barrett Resources for $2.5 billion in cash and stock, topping a $2 billion hostile bid by the U.S. unit of Royal Dutch/Shell Group.

Denver-based Barrett put itself up for sale in a formal auction after Shell mounted its effort in March.

The boards of Williams and Barrett have approved the deal, Williams announced Monday. Shell had no immediate comment.

The deal would give Williams, a Tulsa, Okla.-based energy trader and pipeline operator, a boost by making it a producer and distributor of natural gas.

``This demonstrates our commitment to growth by investing in quality assets for the benefit of our shareholders,'' said Kenneth Bailey, Williams' chairman, president and CEO.

Shell initially offered $55 per share for Barrett, valuing the company at about $1.8 billion, but later sweetened its offer to $60 per share.

Williams said it will pay $73 per share for 50 percent of Barrett's outstanding stock, then pay 1.767 shares for each remaining Barrett share. Williams will also assume $300 million in Barrett debt.

Williams was one of a few companies that last week submitted bids for Denver-based Barrett. The company was forced to disclose its interest in Barrett last week when Wall Street analysts mistakenly were patched into a conference call in which board members were discussing a potential bid.

Barrett is coveted for its significant presence in the Rocky Mountain region, which is becoming increasingly valuable to gas producers because of declining production in traditional markets of Texas and the Gulf of Mexico.

Williams plans to retain most of Barrett's 237 employees and will not close its headquarters in Denver, said Steven Malcolm, Williams' executive vice president.

Williams posted 2000 revenue of $10.4 billion, and its net income in 2000 more than doubled, to $524.3 million from $221.4 million.

The company has 1.2 trillion cubic feet of proven natural-gas reserves, mostly in Colorado, New Mexico and Wyoming, and has one of the largest natural-gas pipeline systems in the country, with 11,300 miles of pipe.

Williams shares were trading down $3.30, or 8 percent, at $38.37, in trading Monday morning on the New York Stock Exchange. Shares of Barrett were up $1.95, or 3 percent, to $69.25, also on the NYSE.