Walmart will give JD.com ownership of Yihaodian's marketplace, including the brand, website and app.
In exchange Walmart will take a near 5% stake in JD.com, China's second largest e-commerce firm after Alibaba.
Walmart took full control of Yihaodian last year, but has struggled to grow its market share.
"We're excited about teaming up with such a strong leader in JD.com, and the potential that this new relationship creates for customers in China, as well as for our businesses," said Walmart chief executive Doug McMillon.
Walmart will be listed as a preferred seller on JD.com, offering it greater exposure to the Chinese market.
Walmart's Sam's Club brand will launch a shop on JD.com's website.
The deal will also help grow Yihaodian in the western and northern regions of the country where it is less well-known.
"We look forward to further developing Yihaodian, which has tremendous strength in important regions of eastern and southern China," said JD.com chief executive Richard Liu.
Yihaodian's sale of food and beverages, home goods and electronics accounts for just 1.5% of web sales in China, according to research firm iResearch
According to Walmart, the website had more than 100 million registered customers in July 2015.
The two companies also announced plans to improve supply chain management and increase the amount of imported goods.

"The gritters are now travelling to various workshops for maintenance, just like getting a car serviced," said a highways official.
The "low-risk" season begins in October with "high-risk" starting in November.
The county council said they had to think about the upcoming winter even when it was "boiling hot".
The fleet of more than 40 vehicles covers about 1,865 miles (3,000km) of roads including all major traffic routes and selected A and B roads.
Officials said the service was stood down in April but had to start again surprisingly soon.
Richard Fenwick, from county council highways, said: "The end of summer is a busy time, even when it is boiling hot we have to think about it.
"We have drivers go out during the day to make sure they know the routes, iron out any wrinkles."
The authority said it had about 35,000 tonnes of salt in stock and would expect to use about 25,000 tonnes in an average year.

Merlin Entertainments Group (MEG), which runs the attraction, filed an application in 2014 to build lodges which was rejected by the council.
The Warwick Society said the plans for glamping - or luxury camping - were not in keeping with the landscape.
MEG has previously said the site would "benefit the wider economy".
The firm applied for permission to erect up to 20 permanent lodges, and create room for 41 glamping tents on land known as "Foxes Study".
It was previously granted permission to erect a temporary site for "medieval glamorous camping".
Neighbours at the site objected to the lodges, with one saying the move would be the "first step in turning this historic heritage site into a theme park".
James Mackay, chairman of the Warwick Society, said: "Merlin is a very successful company but the proposal to use part of a Grade I listed landscape for holiday lodges is not at all satisfactory."
Warwick District Council said any public inquiry would probably be held in March.
However, it added MEG had submitted a revised application - a "scaled-down" version of the original - which would go before the planning committee in September or October.
MEG said: "Warwick Castle submitted an appeal to the decision to refuse our planning application to build new accommodation, several month ago.
"However we have also been working closely with the experts at Historic England to develop a significantly revised and reduced accommodation proposal which we hope will be approved.  If the current application is approved we will not progress with the appeal."
Walmart has announced a partnership with the Chinese e-commerce firm JD.com to help revive the US company's struggling website Yihaodian.
[NEXT_CONCEPT]
Gritting lorries and snowploughs have been out and about on Lincolnshire's roads - in preparation for the start of the snow risk season.
[NEXT_CONCEPT]
The owners of Warwick Castle are appealing after a council rejected plans to put a permanent "glamping" site in its grounds.