The San Francisco 49ers have officially announced that the team has agreed to terms with former Minnesota Vikings running back Jerick McKinnon. Aaron Wilson of the Houston Chronicle reported on Wednesday that the deal is for four years at a potential value of $30 million, which makes McKinnon the fourth-highest paid running back in terms of average salary per season ($7.5 million).

"Jerick has proven to be an extremely versatile football player whose speed, elusiveness and tackle-breaking ability make him a very difficult matchup for defenses," said 49ers general manager John Lynch via a statement issued by the team.

The 49ers reportedly got involved in a bidding war to acquire McKinnon, according to Bay Area News Group. Ben Volin of the Boston Globe reports that McKinnon was close to signing with the New York Jets, but San Francisco came back with an offer he could not turn down.

"I want to thank the Vikings organization and coaches for making my dreams come true of being drafted, and giving me the opportunity ... to start my career in the great state of [Minnesota]," McKinnon told fans via Twitter on Wednesday. "I will forever be thankful for that and [Minnesota] will always hold a special place in my heart."

RELATED 49ers agree to terms with former Giants offensive lineman Weston Richburg to a 5-year deal

McKinnon (25 years old, 5-9, 205), who played college football at Georgia Southern, was a third-round draft pick by the Vikings in 2014. Over the past two seasons, he has contributed 1,109 rushing yards on 309 carries with five touchdowns. McKinnon also added 94 receptions for 676 yards with four touchdown catches.

Following Dalvin Cook's torn ACL during Week 4 of 2017, McKinnon joined Latavius Murray to create one of the best running back tandems in the league. He rushed for 570 yards on 150 carries (3.8 yards per carry) with three touchdowns last season. In four seasons with Minnesota, McKinnon has rushed for 1,918 yards with seven touchdowns and a career average of 4.0 yards per carry.

RELATED Details on running back Jerick McKinnon's 4-year deal with 49ers

As McKinnon joins the 49ers, the team's starting running back in 2017, Carlos Hyde, is headed to the Cleveland Browns on a three-year deal reportedly worth $15 million. Hyde carried the football 240 times for 938 yards, eight touchdowns, and had a career-high 59 receptions for 350 yards last season, which was his first healthy year as a starter.

McKinnon was a player that Peter Schrager of NFL Network's "Good Morning Football" recently named as a player he'd like to see in San Francisco. Schrager was the first person to report on Wednesday morning that McKinnon intended to sign with the 49ers.

"Jet is going to get a lot of interest in the free agency market because he can play both running back, third down, and do a little stuff at wide receiver and special teams," Schrager said.

McKinnon ran a 4.41-second 40-yard dash at the NFL Scouting Combine in 2014, which was second only to Dri Archer among running backs that year. He joins a group of 49ers running backs that have a lot of speed with both Matt Breida and Raheem Mostert recording faster pre-draft 40-times.

* Story updated to reflect corrected $30 million contract number