NEW YORK (AP) -- Supermarket chain Safeway said Monday that it agreed to resolve a shareholder lawsuit over its pending sale to an investment group led by Cerberus Capital Management.

Safeway said it will terminate its "poison pill" shareholder rights plan on Thursday instead of letting the plan expire in September. Such plans are often used to deter unwanted takeovers. The company also adjusted terms of the deal related to its ownership of Casa Ley, a Mexican food and merchandise retailer.

Shares of Safeway gained 10 cents to $34.19 in Monday's trading. They have been steady over the past three months but are up 57 percent since a year ago.

In March Cerberus agreed to buy Safeway for $7.64 billion, or $32.50 per share, in cash. Pending other transactions the deal could top $9 billion, or about $40 per share. As part of the latter deal, Safeway said it would sell its 49 percent stake in the company, and if it failed to do so in four years, shareholders would get a cash distribution equal to the value of its holdings. On Monday, it shortened that period to three years.

The Pleasanton-based company has more than 1,300 U.S. locations under names including Safeway, Vons, Pavilion's, Randall's, Tom Thumb and Carrs. Cerberus and other investors own Albertsons, Acme, Jewel-Osco, Lucky, Shaw's and other stores through a company called AB Acquisition. Combined, the companies will have about 2,400 stores.

Safeway and other grocery store operators have been trying to adapt as people are increasingly doing their shopping at big-box stores like Target, drug stores and even dollar stores. In addition, grocers are trying to balance customers' need for low price food with fluctuating food costs.

The deal is expected to close during the fourth quarter of 2014, It requires approval from Safeway shareholders and federal regulators. The Federal Trade Commission asked for more information about the deal in April.