Deerfield, Ill.-based Walgreen said it would pay $75 a share in cash to buy Walnut Creek, Calif.-based Longs, besting CVS's price of $71.50 per share, also in cash, which was equivalent to about $2.7 billion. Either deal would also include the assumption of about $200 million in debt.
Longs shares rose 4 percent to $74.50 in after-hours trading.
Walgreen CEO Jeffrey Rein said in a letter to Longs' board of directors that the company would prefer to negotiate with Longs directly but also was prepared to take the offer directly to the company's shareholders.
Rein also noted in the letter, which Walgreen disclosed in a press release late Friday, that Walgreen had expressed an interest in acquiring Longs earlier for $70 a share but never received due diligence materials from the company.
Longs has face dissent from some shareholders over the value of the CVS deal.
Earlier Friday, one of the largest shareholders in Longs said it opposed the deal with CVS and had identified four other potential buyers for the drug store chain.
Pershing Square Capital Management, which owns about 3 million shares - a 9.2 percent stake
- of Longs, has previously said that CVS's bid didn't adequately value Longs' real estate holdings.
Two other major shareholders, Advisory Research and CtW Investment Group, have also publicly questioned the CVS deal.
Speaking in a television interview Friday before the Walgreen announcement, CVS Chief Executive Tom Ryan said the company does not intend to raise its bid.
"We think we are paying a full and fair price," he said. "We're not moving. We're done."