Maersk said it was selling 48.7 percent of Dansk Supermarked, which owns 1,200 supermarkets in Scandinavia, Germany and Poland, and 18.7 percent of department store chain F. Salling for about 17 billion Danish crowns ($3.1bn).
Privately held Salling Companies, which co-founded Dansk Supermarked with Maersk fifty years ago, is buying the shares.
Maersk, Denmark's largest company by revenue, is selling the stakes as part of a five-year plan to shrink its sprawling business empire to five core areas and increase return on invested capital, a key performance measure.
The group, which includes core business Maersk Line - the world's largest container shipping company by revenue - has about 1,000 subsidiaries around the world.
Chief Executive Nils Smedegaard Andersen declined to comment on Maersk's long-term plans for cash generated by the share sales.