The directors of Safeway Stores Inc. yesterday arranged to sell the world's largest supermarket chain to a newly formed corporation for $4.1 billion to keep it out of the hands of Washington retailers Herbert H. and Robert Haft.

Rejecting the Hafts' offer to buy all Safeway's stock for $64 a share, Safeway accepted a $69-a-share bid from SSI Holdings Corp., a firm created by Kohlberg Kravis Roberts & Co., a specialist in arranging corporate buyouts.

SSI says it will pay $3.1 billion cash for 73 percent of Safeway's stock and then will acquire the rest in exchange for about $1 billion worth of securities in the new company.

The buyout is meant to keep the Hafts from buying control of Safeway, but it could give the family almost a $100 million profit on the 3.6 million shares of Safeway stock it owns.

The Hafts paid slightly more than $41 a share for their Safeway stock and could make approximately $28 a share if they sell their stock back to Safeway. Starting in May, the Hafts invested $149.5 million in Safeway stock that is worth more than $248 million under yesterday's offer.

In a lawsuit filed to try to stop the Hafts from taking over the company, Safeway contended that the millionaire Washington retailers were only trying to push up the price of Safeway stock so they could sell theirs for a profit.

The Hafts still can make another bid for the entire company.

Representatives of the Hafts said last night that they will study the Safeway offer before deciding what to do.

Safeway will become a private company, and its present management will own up to 10 percent of the new company and could continue to run the chain if the transaction announced yesterday is completed as planned.

SSI Holdings will finance the stock buyback by borrowing $3 billion from a group of banks led by Bankers Trust Co. of New York.

The transaction is what is known on Wall Street as a "leveraged buyout" because the buyers will borrow the money using Safeway itself as collateral for the loan.

It was not clear yesterday what effect the buyout would have on the 160 Safeway stores in the Baltimore-Washington area, a spokesman for the company said.

Safeway may be forced to sell some of its operations to pay off the $3 billion loan. There has been speculation that Safeway might sell its Washington regional operations -- one of its most valuable divisions -- or its highly profitable overseas operations to finance the deal.

Although Safeway would no longer be a publicly traded company after the transaction, the offer to Safeway shareholders raises the possibility that SSI Holdings might sell stock to the public later.

But the spokeswoman said, "There is not an immediate plan to go public."

The Hafts disclosed in a report to the Securities and Exchange Commission on June 12 that they had bought about 6 percent of Safeway and might try to take over the company. On July 9, they offered to buy Safeway for $3.6 billion -- $58 a share.

The Hafts founded three local retail chains -- Dart Drug, Crown Books and Trak Auto -- but later sold the drugstores to concentrate on their newer ventures.

The investment in Safeway was made through Dart Group Inc., the company that formerly owned the drugstores. Some Dart Group shares are traded in the over-the-counter market, but the Hafts control all the voting stock in the company. Part of the Safeway investment was made by Combined Properties Inc., a private Haft family company that owns two dozen local shopping centers and other real estate.

Late last week, Dart had said it would vigorously contest any leveraged buyout and complained that Safeway had refused to talk with Dart despite numerous requests.

"It is clear that you are favoring another bidder at any cost," Dart complained in a letter to Safeway last week.

Under terms of yesterday's agreement, a subsidiary of SSI will offer Safeway shareholders $69 in cash for up to 45 million of the company's 61 million shares outstanding, the company said yesterday. This offer will be followed by a merger of Safeway and the subsidiary in which the remaining shareholders will receive securities in the new corporation.

For each share, they will get a debenture -- a security similar to a note -- worth $61.60 a share, plus one warrant to purchase common stock of SSI if the company ever goes public.

If shareholders of more than 73 percent of Safeway's stocks wanted cash, they would receive a prorated combination of cash and securities.

In its attempts to thwart Dart, Safeway had instituted two antitakeover defenses that were altered by the board yesterday, the spokeswoman said.

Previously, Safeway had required 80 percent approval by shareholders of any merger agreement, the spokeswoman said. As a result of yesterday's board action, only a two-thirds vote is now needed, which makes it easier for the KKR deal to go through.

Additionally, Safeway's board said it would repeal a provision instituted in February that gave Safeway shareholders the right to purchase $200 worth of stock for $100 in any company buying Safeway.

The merger agreement "provides value to our shareholders greater than any other offer we have received," a Safeway statement said. "At the same time," the company's repeal of its antitakeover measures "insures that our shareholders will be able to take advantage of any better offer if there is one."

KKR is the leading firm specializing in leveraged buyouts. It financed two of the largest recent takeovers: the $6.2 billion acquisition of Beatrice Cos. Inc. and the $2.5 billion acquisition of Storer Communications Corp.

KKR has billions of dollars of pension-fund assets and bank loans at its disposal to invest in buyouts.