Walmart said it would pay $3 billion in cash, part of which would be paid over time along with an additional $300 million in its shares.
Jet.com was launched by Marc Lore in July last year. Its initial strategy was to offer large discounts and the lowest prices on items based on a pricing formula that took into account factors such as basket size for an annual $50 fee.
But three months after launch, Jet changed strategy and eliminated its subscription model.
"We're looking for ways to lower prices, broaden our assortment and offer the simplest, easiest shopping experience because that's what our customers want," Walmart Chief Executive Doug McMillon said.
The Wall Street Journal reported last week that Walmart was in talks to buy the online discount retailer.
While Walmart and Jet will maintain distinct brands, they will leverage technology from both companies to develop new offerings, Walmart said.
Walmart's online business posted its slowest growth in a year in the latest quarter. Sales in the unit were $13.7 billion in 2015, according to research firm Internet Retailer.
Allen & Company and J.P. Morgan Securities LLC were financial advisers to Wal-Mart for the deal.
Walmart's shares were up 0.7 pct at $74.25 in light premarket trading on Monday.