New York CNN Business  — 

Kroger and Walgreens want to find new customers and stave off competition in a crowded market for retailers and pharmacies. So they’re doing it together.

The two companies this week said that Kroger (KR) will open mini “Kroger Express” stores inside 13 Walgreens (WBA) pharmacies. It’s a creative arrangement that blurs the lines between traditional grocers and drug store chains. It’s a test, and if it works, they plan to try the concept in other locations.

One of the stores has already opened, and the other dozen will be up and running by early next year. The stores, all near Kroger’s headquarters in Cincinnati, will sell national brands as well as Kroger’s private-label dairy, meat, produce and frozen foods. Customers will also be able to buy meal kits from Home Chef, which Kroger bought earlier this year.

The Express section will take up a little less than one-third of each Walgreens location. Walgreens employees will still stock and operate the Kroger aisles, and there won’t be separate cash registers for checkout.

The two companies were already working together on a smaller scale. In October, Kroger began offering online grocery pickup at the same 13 Walgreens locations. The financial terms of both that deal and the new one were not disclosed.

Analysts say the two chains believe the other can help fill weaknesses in their businesses while fending off new competition.

“Kroger brings the strength of food knowledge and credibility to the partnership, and Walgreens brings access to real estate,” said Tory Gundelach, a retail analyst at Kantar Consulting.

Amazon is one of the biggest threats that either company faces. It recently purchased PillPack, an online pharmacy service. And it bought Whole Foods last year, giving it a presence in grocery.

Kroger will open mini "Kroger Express" stores inside 13 Walgreens with meat, produce, and frozen foods.

A fresh approach for Walgreens

That kind of competition means that Walgreens needs to give customers reasons to visit, said Jason Goldberg, chief commerce strategy officer at Publicis Communications.

Most of the company’s traffic today comes when people pick up their prescriptions. But that advantage will weaken as Amazon enters the pharmacy business and as more prescriptions are home delivered.

Walgreens, which is located mostly in urban areas, has struggled to convince shoppers to buy snacks, drinks and fresh food at the pharmacy. Customers can buy most of that stuff online or at convenience stores. The company’s consumable sales fell last year, according to filings.

Walgreens knows it needs a new approach, and so has settled on outside partnerships as the solution. It struck a deal with FedEx (FDX) for package pick-ups and drop-offs in stores, and recently partnered with Sprint (S) to open “Sprint Express” stations. Walgreens also tapped Birchbox, the online beauty retailer, to help expand its makeup aisles.

Selling quick-trip food is only getting harder. Target (TGT) is opening up 30 small stores a year to snag shoppers in major cities. Amazon (AMZN) and Walmart’s (WMT) Sam’s Club are piloting cashier-less stores.

Kroger’s grocery expertise, meanwhile, should help Walgreens stand out, according to Bill Bishop, co-founder of the grocery consulting firm Brick Meets Click.

“Walgreens’ store network makes them a very logical location for customers who are trying to decide what’s for dinner at 4 p.m.,” he said.

Building loyalty at Kroger

For Kroger, the agreement expands distribution and introduces the brand to new customers.

The grocer faces pressure from both ends of the market — Whole Foods at the high end, and rapidly expanding discount grocers such as Aldi and Lidl at the low end. Last month, Lidl acquired a couple dozen Best Market grocery stores in New York and New Jersey.

Kroger believes Walgreens can help it promote and build customer loyalty for in-house products like Home Chef and Simple Truths, an organic brand. The grocery chain said separately on Tuesday that it will sell Home Chef at 65 Walgreens stores in Chicago.

Success for both companies isn’t guaranteed. Rite Aid (RAD) and Albertsons, for example, called off plans to merge earlier this year after they could not agree on financial terms.

“The biggest challenge for the partnership is most likely the two retailers coming to terms that both parties consider fair,” said Kantar’s Gundelach.

Gundelach said she does not expect the two sides disagree at first, especially over meal kit sales or grocery pickups. But she said conflict could emerge if they decide to collaborate in areas where both companies have experience, such as health and wellness.