Municipally operated liquor stores in Minnesota saw record sales in 2016 but also a retreat in profits, according to an annual analysis released Tuesday.

Sales last year among the 228 municipally operated stores totaled $344.4 million, a 2.1 percent increase over 2015, the report by the State Auditor’s Office revealed. Leading the way among all “munis,” as they are called, was Lakeville’s stores with $14.1 million in sales across the city last year.

While the money is coming in like never before, the combined net profit across the state shrank from 2015 to 2016 by 8.4 percent to $22.8 million. Metrowide, 10 cities saw shrinking profits from 2015 to 2016.

And despite sales increasing statewide for 21 consecutive years, profits over the past five years have fallen by 16.4 percent, the analysis found.

The report gave no explanation for dwindling profits but in recent years, municipal liquor stores have felt increasing competitive pressure.

Total Wine, a deep-discount retailer with warehouse-sized stores, has expanded to many Twin Cities suburbs. Target also has added liquor sales to its Minnesota stores in recent years.

When a Total Wine opened in Bloomington in late 2014, neighboring Edina spent more than $300,000 to renovate and upgrade its three stores and turned to cutting prices.

Sunday liquor sales debuted in Minnesota in July, and next year’s state report could shed light on whether that historic shift further pressures municipal-store profits.

There were 45 cities statewide whose liquor operations ended up in the red last year, and 44 of those were outside the metro area.

Savage was the lone municipality in the Twin Cities area to have its liquor operations lose money. Its two stores’ losses came to $106,175, the state report said. There are 19 cities in the metro that operate liquor outlets, and they combine for more than a third of all municipal sales in the state.

Minnesota municipalities were originally authorized to own and operate liquor establishments as a means of controlling the sale of alcohol.

For many communities outside the Twin Cities area, these operations provide access and convenience that might be unable to attract a privately run establishment.

For metro municipalities, operating liquor stores generates money to supplement traditional tax and fee revenue.