Walmart said on Wednesday that it planned to offer home delivery of groceries bought online in 100 cities in the United States, as it seeks to compete with rival retailers, led by Amazon, amid an accelerating campaign for control of America’s kitchen cupboards.

Walmart has invested heavily in its online offerings in hopes of keeping pace with changing consumer tastes, but stumbled in last year’s fourth quarter when it experienced a 23 percent slowdown in online sales-growth — less than half the growth rate in each of the three previous quarters.

Walmart currently provides home delivery of groceries bought online in six markets. In its announcement on Wednesday, the company said the service would be available to more than 40 percent of households in the United States by the end of 2018.

“We’re saving customers time by leveraging new technology, and connecting all the parts of our business into a single seamless shopping experience: great stores, easy pickup, fast delivery, and apps and websites that are simple to use,” Greg Foran, the chief executive of Walmart U.S., said in a news release.

Walmart charges a $9.95 fee for its grocery delivery service, and requires a minimum order of $30.

In another effort to bolster online sales, Walmart said earlier this year that it planned to accelerate its web-based grocery business by increasing the number of stores where customers can order food online and pick it up at stores. That service, available at 1,200 stores, will expand to 1,000 more stores later this year.

The announcement that Walmart was expanding its home delivery service came less than a year after Amazon acquired the upscale grocery chain Whole Foods for $13.4 billion.

That deal has prompted other players in the grocery industry to expand their home-delivery offerings.

In December, Target said it would acquire the online same-day delivery service Shipt for $550 million in cash. On Monday, Kroger said that it would increase the number of cities where it offers home delivery of groceries through Instacart, a same-day service.

Amazon said this month that it would increase to six the number of cities where it offers same-day delivery of groceries.

Elsewhere in the grocery sector, the supermarket operator Albertsons said last month that it would buy the remnants of the Rite Aid drugstore chain, in hopes the in-store pharmacies would increase foot traffic and encourage customers to buy other items.