Rite Aid Corporation and Albertsons Companies announced on Wednesday they are terminating their merger agreement, the evening ahead of a shareholder vote over the deal.

The announcement is a blow to the pharmacy and the grocer, which are both facing mightier competitors in their respective industries, but were unable to structure a deal that sufficiently appealed to investors.

The $24 billion deal, announced in February, has faced push-back from a number of retail investors as well as top ten shareholder Highfields Capital Management. Critics have argued the deal provides Albertsons' private equity owner, Cerberus Capital Management, a vehicle to take the company public without rewarding Rite Aid shareholders in turn.

Adding to mounting challenges, influential investor advisory firms Glass Lewis and Institutional Shareholder Services in July urged investors to vote against the tie-up.

Albertsons, though, said Wednesday it was unwilling to renogotiate the terms of the deal

"After careful consideration of all information available to our board of directors through today, we were unwilling to change the terms of the merger," it said in a statement.

Rite Aid CEO John Standley, meantime, said in a statement, "While we believed in the merits of the combination with Albertsons, we have heard the views expressed by our stockholders and are committed to moving forward and executing our strategic plan as a standalone company."

Rite Aid also said Wednesday that its board is "evaluating governance changes at the company." The company added it will "continue to engage with stockholders" as it evaluates those changes. Neither Rite Aid nor Albertsons will pay a break-up fee.

The pharmacy will hold an annual meeting Oct. 30, 2018.

Shares of Rite Aid closed Wednesday at $1.74 a share, up 1.16 percent, giving it a market capitalization of $1.86 billion. Its shares had tumbled roughly 24 percent since it announced the deal in February.

Albertsons was formed by Cerberus and a consortium of investors in 2006. The investment firm later merged Albertsons with the grocer Safeway in 2015. But plans to take Albertsons public were sidelined by market volatility and, later, Amazon's acquisition of Whole Foods that upended the grocery market.

The grocer has also stumbled in comparison to its peers like Kroger, which has had positive same-store sales the past two fiscal years, ISS said. Albertsons, by contrast, showed same-store sale growth in the most recent two quarters, preceded by negative same-store sales in the past two fiscal years, ISS said.

The grocer is also highly leveraged, with $12 billion in long-term debt and capitalized leases.

Rite Aid has had its own challenges. Regulators thwarted its attempts to sell to Walgreens Boots Alliance, forcing them to whittle down a sale of Rite Aid's entire 4,600 store footprint to just 1,932 locations. Its competitors, which now include a larger Walgreens and a proposed CVS Health-Aetna tie-up, dwarf it in size.

It earlier this week cut its 2019 guidance, citing pressure from generic-drug makers.

Still, investors and shareholder advisory firms weres unsure the deal as structured, and the $375 million in cost-savings the retailers say it will generate, would sufficiently absolve them of their woes.

"Strategically, the proposed merger appears to be a step in the right direction, as it provides [Rite Aid] with increased scale and diversification. However, the transaction would introduce a new set of risks associated with the grocery business, and the combined company's leverage could limit investment in two evolving business environments," ISS wrote.

ISS also said that potential conflicts of interest in the negotiating process "heightened" its concerns about the deal's benefit for Rite Aid shareholders. Among them, Albertsons notified Rite Aid CEO it would like him to be chief executive of the combined company, while still negotiating the deal. Rite Aid later created a negotiating committee that excluded Standley, to negotiate with Albertsons.