Walgreens (WBA) is adding full-service doctor offices next to 500 to 700 stores through a partnership with VillageMD.

The Village Medical at Walgreens facilities will have 3,600 primary care providers onsite across 30 U.S. markets over the next five years, with hundreds of more clinics to come in the future. The clinics will also have a pharmacist on staff.

Through the clinics, Walgreens will offer 24/7 healthcare via telehealth and at-home visits as well as a verity of medical care options. More than 50% of the locations will be co-located in underserved areas and regions where healthcare professionals are at a shortage.

“In the U.S., we spend $4 trillion per year on healthcare, over 85% of that is tied to patients with chronic diseases,” Tim Barry, chairman and CEO, VillageMD, said in a statement.

“To improve our healthcare system and reverse the trajectory of health spending, we must meet the needs of all patients.

“This partnership allows us to unleash the power of primary care doctors and pharmacists, enabling them to work in a coordinated way to enhance the patient experience.”

The clinics will be about 3,300 square feet in size, with some as large as 9,000 square feet. Inside the facilities will also be a range of retail products for patients to purchase.

“These clinics at our conveniently located stores are a significant step forward in creating the pharmacy of the future, meeting many essential health needs all under one roof as well as through other channels,” Stefano Pessina, executive vice chairman and CEO of Walgreens, said in a statement.

The move by Walmart comes as the retailer looks to expand its customer offerings by targeting healthcare services, where consumers spend more time and money, CNBC said.

By transforming its stores into health and wellness locations, Walgreens can offer customers more reason to visit its stores. The company has leases with For Eyes, an optical company, and weight loss business Jenny Craig to progress this strategy, the news outlet said.

Terms of the agreement between the two companies have Walgreens investing $1 billion in equity and convertible debt in VillageMD over the next three years. This also includes a $250 million equity investment that will be made on Wednesday.

The investment will fund 80% of the opening of VillageMD’s clinics while integrating with Walgreen’s digital assets. Walgreens will hold a 30% interest in VillageMD upon completion of the investment.

Walgreens and Village MD underwent a trial of five co-located medical facilities last year in the Houston area that the companies said were successful.

Shares of Walgreens were trading at $42.36 as of 12:13 p.m. ET, gaining $0.14 or 0.33%.

Walgreens will open 500 to 700 medical clinics in 30 U.S. markets over the next five years. Walgreens Boots Alliance