The 49ers gave up a conditional seventh round pick — one of many at their disposal — for the third-year pro. Martin needs to be on the 53-man roster after final cuts for the Dolphins to get the pick.

Martin leaves Miami reeling from a supposed scandal that may have ended former teammate Richie Incognito’s career.

After Martin left the Dolphins last season, some players weren’t advocates of Martin sticking in South Beach. The 49ers were able to capitalize.

Martin was drafted by the Dolphins after playing under Jim Harbaugh at Stanford, a second-round selection who struggled last season before the drama-filled news broke.

The 49ers have sought depth along the offensive trench, with injuries to linemen Mike Iupati, Joe Staley and Alex Boone. Another plus with Martin is a minimal cap hit of little more than $800,000 — a huge plus for the cash-strapped 49ers.

Despite Martin’s detractors in Miami, the 49ers’ locker room has said they’d welcome Martin. Asked by TMZ if Martin would be handled with “kid gloves,” 49ers guard Adam Snyder replied:

“We’re gonna treat him like any other free agent that comes into our locker room.”

Snyder continued:

“It’s a great new opportunity for him. He’s coming in to a great group of guys, specifically the offensive line.”