Walmart’s investments in e-commerce are paying off. The retailer today announced its U.S. e-commerce sales grew by 37 percent in the first quarter, largely thanks to its booming online grocery business and growth in both the home and fashion categories on Walmart.com.

The company also beat analyst estimates for the quarter, with earnings per share of $1.13 versus $1.02 expected, and revenue of $123.93 billion compared to estimates of $125.03 billion. U.S. same-store sales growth was 3.4 percent in the quarter, versus the expected 3.3 percent increase — making it the fourth consecutive quarter above 3 percent, and the best Q1 in 9 years.

Operating income, however, declined in the quarter, as strong sales from Walmart U.S. and Sam’s Club stores were offset by the inclusion of Flipkart, the retailer said.

The company has been heavily investing in the key categories of home, fashion and grocery over the past several years as part of its efforts to better compete with Amazon and expand into categories where there’s still much room for online growth.

In Home, for example, Walmart last year launched a redesigned Home shopping experience on the web that highlighted furniture, home accessories and other decorative items, broken down by style categories. The updated site also had a more editorial feel with larger, magazine-like imagery and design tips written by in-house staff.

Later in the year, the full Walmart.com redesign rolled out, which put an increased emphasis on specialty shopping experiences across home and fashion — the latter featuring seasonal stories and fashion editorial to make buying an outfit feel much different from buying groceries or other household items. The fashion destination went upscale, as well, with a section dedicated to Lord & Taylor — the result of a partnership that made Walmart the new e-commerce home for the high-end retailer.

Meanwhile, Walmart has been expanding its online grocery business with an eye towards leveraging its thousands of brick-and-mortar storefronts across the U.S.

Instead of marking up prices like Instarcart does, Walmart lets customers order groceries online and pay the same price as they would in stores. Customers then drive the mile or two to their local Walmart and pick up their prepared and bagged groceries at a dedicated curbside pickup spot.

The pickup service is available at 2,450 Walmart locations while grocery delivery is offered through partners like Point Pickup, Skipcart, AxleHire, Roadie, Postmates and Doordash at nearly 1,000 locations. The retailer plans to offer pickup at 3,100 locations and delivery at 1,600 by year-end, providing coverage to approximately 50 percent and nearly 80 percent of the U.S. population, respectively.

Other e-commerce investments in Q1 included the launched a new personalized baby registry and online pet pharmacy, the introduction of Walmart Voice Order through Google Assistant, and the addition of several exclusive brands online — including denim from Sofia Vergara, the MoDRN brand in the Home category, the Hello Bello brand in the Baby category with Kristen Bell and Dax Shepard, the Flower brand in the Home category with Drew Barrymore, and Bobbi Brown’s health and wellness line Evolution_18.

“We’re changing to enable more innovation, speed and productivity, and we’re seeing it in our results,” Walmart CEO Doug McMillon said in a statement. “We’re especially pleased with the combination of comparable sales growth from stores and e-commerce in the U.S. Our team is demonstrating an ability to serve customers today while building new capabilities for the future, and I want to thank them for a strong start to the year.”