Kroger, one of the country’s largest grocery chains, announced Tuesday a $2.5 billion deal to acquire rival Harris Teeter.

The move, which must be approved by federal regulators, would extend Kroger’s reach, particularly in Virginia, Maryland and the District, where Harris Teeter has 51 stores. If the deal is approved, Kroger will be able to leverage its bigger size to compete against low-cost grocers such as Wal-Mart, which have moved aggressively into fresh produce, analysts said.

Cincinnati-based Kroger said that it does not plan to close any Harris Teeter locations and that the stores will keep their name. But the deal was met with skepticism from some Harris Teeter loyalists. Among the hundreds of posts on the sale that appeared on Harris Teeter’s Facebook page Tuesday, one shopper said: “This is horrible news. I am so disappointed!”

The deal delivers to Kroger an expanding market. Harris Teeter stores are generally concentrated in upscale areas near universities and vacation destinations, attracting more affluent clients, analysts said. Harris Teeter also offers another advantage for Kroger: more fresh food.

“A lot of traditional grocers are still struggling from the competitive threat of companies like Wal-Mart that have moved aggressively into food,” said Kenneth Perkins, an analyst at Morningstar. “They’ve been struggling from that perspective, and they’re trying to keep people coming through their doors. Kroger, to their credit, has done a good job with that.”

Kroger said it expects to achieve annual cost savings of approximately $40 million to $50 million over the next three to four years. It was too early to tell if those savings would be passed onto shoppers, said Kroger spokeswoman Kari Armbruster. “That’s something we’ll have to look into once we actually have the business plan all done,” she said.

Investors were upbeat on the deal. Kroger’s stock rose nearly 3 percent on the news, while Harris Teeter was up about 1.5 percent.

Kroger will pay $49.38 per share for Harris Teeter stock, a 1.77 percent premium over Monday’s closing price. Kroger also will assume $100 million of Harris Teeter’s outstanding debt.

Kroger’s same-store sales, a key measure for retailers, have been improving over the past year, even as grocers across the country are seeing profit margins shrink as they scramble to keep up with low-cost competitors. Even with $96.8 billion in revenue last year, Kroger trails Wal-Mart as the country’s largest supermarket chain.

“Strategically, it makes a lot of sense,” said Perkins. “The profit margins at Harris Teeter are slightly higher than they are at Kroger, and it gives Kroger the opportunity to grow into new areas.”

Harris Teeter will keep its headquarters in Matthews, N.C., and operate its stores as a subsidiary of Kroger, according to a company statement.

“It’s very important for us to be locally relevant,” said Lynn Marmer, vice president of corporate affairs at Kroger. “We don’t operate one-size-fits-all stores. They’re customized to the markets where they’re located, and they oftentimes have a name that’s different from the Kroger name.”