Updated from 3:13 p.m. ET

Phillips Petroleum

(P)

said Sunday it agreed to buy

Tosco

(TOS)

for $7 billion in stock.

"This transaction transforms Phillips into a stronger major integrated oil company," the company said in a press release. "The new Phillips has the balanced assets, scale and financial flexibility necessary for continued profitable growth. Phillips will be a premier competitor in the domestic refining, marketing and transportation business, and will benefit from the competitive advantages of integration through its role as a major participant in the global exploration and production business, and its gas gathering and chemicals joint ventures."

The Wall Street Journal

, which first reported the deal Sunday, noted that the deal would make Phillips the nation's second-biggest oil refiner and fifth-biggest gas retailer. But the newspaper, in a report in its online edition Sunday, also said the move runs counter to industry trends, which involve dumping refining operations to focus on more profitable exploration and production.

Phillips is paying 0.80 of one of its shares for each Tosco share. Phillips closed Friday at $58.13, while Tosco closed up 62 cents at $34.61. It'll also assume $2 billion in Tosco's debt. The company expects the transaction will close by the end of the third quarter.

Phillips also said its board authorized a $1 billion share buyback program. With the buyback and projected cost savings of $250 million from the deal, Phillips expects that the transaction will add to earnings per share.