O'Neil landed the defensive coordinator job in San Francisco on new head coach Chip Kelly's staff after Houston Texans linebackers coach Mike Vrabel turned it down.
Others reported to be in consideration for the position were 49ers linebackers coach Jason Tarver and Baltimore Ravens linebackers coach Don Martindale.
O'Neil worked under Mike Pettine when the two were with the Buffalo Bills as assistants before moving to Cleveland when Pettine took over as the Browns' head coach in 2014.
The 37-year-old O'Neil didn't have much success the past two seasons. The Browns were 23rd and 27th in total yards allowed in 2014 and 2015 and 30th in rushing defense last year.
O'Neil replaces fired Eric Mangini as defensive coordinator. The 49ers were 29th in total yards allowed and 18th in scoring defense last year.