E-commerce company eBay has sold its 28.4 percent stake in Craigslist back to the online classified advertising site, ending years of legal wrangling between the two companies.

The move announced Friday comes as eBay prepares to split with its online payments system PayPal. Financial terms were not disclosed.

EBay, which is based in San Jose, California, bought a stake in Craigslist in 2004. But the two companies have tussled in the legal arena. Craigslist has long accused eBay of using to start its own classifieds site in the U.S. in 2007.

In 2010, a judge ruled that Craigslist founder Craig Newmark and CEO Jim Buckmaster violated their responsibilities to eBay with changes they implemented that diluted eBay's share from 28.4 percent to 24.9 percent and made it harder for eBay to sell the stake.

EBay said with the repurchase, all litigation between eBay and Craigslist will be dismissed. It declined to comment further.

Craigslist posted an excerpt of eBay's statement on its blog along with an excerpt of Shakespeare's "All's Well That Ends Well," including the line "Love all, trust a few."

Shares in eBay Inc. rose 37 cents to $61.06 in afternoon trading.