San Francisco and Detroit announced the trade on Thursday. Harold must pass a physical for the trade to be executed.
"Our entire organization would like to thank Eli for his hard work and contributions to our team and the Bay Area community over the last three years," 49ers general manager John Lynch said. "He always represented the 49ers with class and has been a tremendous teammate. We wish Eli and his wife, Kelsey, nothing but the best in the years to come."
The Lions waived defensive lineman JoJo Wicker in a corresponding transaction.
Harold, 24, was a third-round pick by the 49ers in the 2015 NFL Draft. The 6-foot-3, 257-pound defender had 34 tackles and two sacks in 16 games last season for the 49ers. He started 11 games during the 2017 season. For his career, Harold has 84 tackles, five sacks, two fumble recoveries and a forced fumble in 48 games.
The Lions have Devon Kennard, Jarrad Davis and Christian Jones listed as their starting linebackers.