The news of Walmart closing its only store in St. Paul shocked shoppers. How can a store that seemed so busy close?

"There is no single reason for closing the store," Walmart spokeswoman Tiffany Wilson said in an e-mail. "Retail is changing rapidly and it's more important than ever to make sure we are evolving with the needs of customers. Any closure comes after an extensive review, including the financial performance of the store."

What are some of the reasons for closing a store?

Analysts say one major factor is that the location in Midway is too small with an inadequate grocery selection. The Walmart corporation now has about 3,600 Supercenter stores averaging about 178,000 square feet, and fewer than 400 discount stores like the one in St. Paul averaging about 105,000 square feet. The smaller stores don't have the grocery selection that the larger ones do.

In addition to space limitations, Walmart was hamstrung by a lease restriction from nearby Cub, one of the original tenants at Midway Marketplace, as to how much food it could sell. Although Walmart Midway has nearly a dozen aisles of frozen and packaged foods, it could not sell fresh produce. That's a major drawback for grocery retailers that depend on frequent trips by customers.

"Walmart figured out that its regular discount stores haven't been as much of a traffic driver as the Supercenters," said Brian Yarbrough, an analyst at Edward Jones. "That's been the biggest area of improvement for Walmart — they've done better on the fresh side and their food business really took off."

Walmart was hobbled by a lack of fresh groceries, allowing nearby Cub, SuperTarget and Aldi to capitalize on it.

"Target and Cub took some of their customers by giving them more food choices," said Dick Grones of Cambridge Commercial Realty in Edina. "Once you get them in the stores they buy other things."

Jayne Darling of St. Paul, who lives six blocks away from Walmart, shopped the store on Thursday. "I definitely shopped here less because they didn't have produce and fewer options of things like bread," she said. "I went more to Cub and Aldi — Target if I needed more than groceries."

Walmart customers such as Barbara McDonal of St. Paul think that the grocery limitation may have hurt, but she thinks the new soccer stadium played a part, too. "The stadium needs more parking," she said. "Maybe the city would rather have a hotel and parking than a Walmart."

Grones said that the number of police calls to the store may have been an issue too. In 2016, the police were called to the St. Paul store more than 2,100 times, compared with 1,100 in the Brooklyn Center Walmart.

"The neighborhood may want something else to attract higher-end tenants," Grones said.

The Midway store will close Sept. 20, although its lease doesn't expire until 2025. Earlier in the week, no additional discounts were offered.