Spartan Stores Inc. agreed to buy Nash Finch Co. in an all-stock transaction valued at $1.3 billion including debt to add grocery distribution serving U.S. military commissaries as well as wholesale operations.

Nash Finch investors will receive 1.2 shares in Grand Rapids, Mich.-based Spartan Stores for every share of common stock they own, the companies said today in a statement. Spartan Stores shareholders will own about 57.7 percent of the combined company and investors in Minneapolis-based Nash Finch will own the remaining 42.3 percent, they said.

“Together, we will create one of the premier grocery wholesaler and retail operators, with a comprehensive portfolio of high-quality private brands, nationwide distribution services and a strong platform for future growth,” Spartan Stores chief executive Dennis Eidson said in the statement.

The combined company, with annual sales of about $7.5 billion, will operate 22 distribution centers covering 37 states as well as 177 retail outlets, they said. Earnings will be boosted starting in the first full year of operations, while annual cost savings of $50 million will be achieved by the third year, the retailers said.