In an ecommerce landscape increasingly dominated by Amazon, Walmart is showing that there is still ample opportunity for growth, although it can come at a cost.

Walmart reported financial results for the June quarter today, with many analysts focusing on how its ecommerce business is doing. The company said the gross merchandise value of its ecommerce operations grew 67 percent in the quarter, with revenue rising 60 percent. While ecommerce revenue growth is down from 63 percent in the previous quarter, it’s up from 12 percent in the year-ago quarter.

After buying Jet.com a year ago and appointing its founder, Marc Lore, as head of its ecommerce operations, Walmart has since bought Bonobos, Moosejaw, and Shoebuy (since renamed shoes.com) to add to its online-retail offerings. But that growth is putting a drag on Walmart’s margins. The company said ecommerce businesses are not only pulling down its gross margins, its operating expenses increased by 3.9 percent in the quarter “primarily due to investments in ecommerce and technology.”

In calls with analysts and reporters to discuss its earnings report, Walmart executives acknowledged the threat that Amazon poses in online retail. Greg Foran, CEO of Walmart U.S., called Amazon “an unbelievably good competitor” that is pushing Walmart to try to excel. “In a market that is improving, you have to do better yourself,” Foran said.

At the same time, the company touted what it sees as advantages over Amazon, including two-day delivery for many goods that doesn’t require an annual, paid membership. Walmart said items available for order online grew 30 percent over the previous three months to 67 million. It has also rolled out grocery delivery to 900 of its U.S. stores, up from 670 stores three months ago.

Much of the 60 percent growth in ecommerce revenue came not from acquisitions but from walmart.com, driven in part by online-grocery sales. “Having stores within 10 miles of approximately 90 percent of the U.S. population allows us to serve customers in ways that are most convenient for them,” Walmart Stores CEO Douglas McMillon told analysts.

Overall, Walmart’s second quarter revenue of $123 billion and earnings of $1.08 per share both beat analyst expectations. The company said full-year earnings would come in between $4.30 a share and $4.40 a share, in line with analyst forecasts.

Yet the stock slumped 2 percent on the earnings as analysts had been expecting a bit more oomph in its efforts to combat Amazon. Walmart’s stock “could be softer given expectations for higher guidance,” Cowen & Co. analyst Oliver Chen explained in a research note. “The war is on vs. Amazon.com, Target, and pricing competition particularly in grocery in the retail marketplace.”

Walmart is “intensifying digital initiatives,” Chen added, and the company’s focus on both price and convenience should help it grow market share. For today, at least, the biggest threat Amazon faces on online retail seems to be falling short of Wall Street’s expectations.