The 49ers announced the deal Friday.
Foster was projected by many to be a top-10 selection after an impressive college career, winning the Butkus Award as the top linebacker in the country at Alabama.
However, he slid on draft day toward the end of the first round before the 49ers nabbed him.
The injury wasn't enough to scare off San Francisco.
"The worst-case scenario, he wouldn't end up being able to play for us right away," head coach Kyle Shanahan told KNBR (via Kevin Spain of USA Today). "But I still don't think that would have changed how I personally felt about taking a guy with the 31st pick with the caliber of player that we took."
OBJ's Trade to Cleveland Has the Browns Hyped
Le'Veon's Power Move Pays Off After Signing Massive Deal with Jets
Friends to Foes, Ex-UGA Teammates Meet in Super Bowl
Cooks Gave a Super Gift to This Rams Employee
Mahomes Loves Ketchup as Much as Torching Defenses
Bears Hoping to Ride Club Dub to the Super Bowl
The Worst Fantasy Football Punishments for Last Place
NFL Players Bring Soccer Traditions to the NFL
JuJu Is a Man of the People
Bills Superfan 'Pancho Billa' Continues to Inspire
Happy 26th Birthday to OBJ 🎉
Mahomes Is 'Showtime' Off the Field Too
Thielen's Ride from Underdog to Record-Breaking WR
Shanahan and His Son Carter Are Hyped for Carter V
Browns Winning Off the Field with Community Service
Conner's Journey from Beating Cancer to Starting RB
Does Donovan McNabb Deserve Your 2019 Pro Football Hall of Fame Vote?
B/R Fantasy Expert Matt Camp Gives His Picks for Keep or Release After Week 2
Does Hines Ward Deserve Your 2019 Pro Football Hall of Fame Vote?
Shaquem Griffin Starting for Seahawks in Week 1
Along with No. 3 pick Solomon Thomas out of Stanford, general manager John Lynch said the team grabbed two of the team's top three players on their draft board in the first round, per Jeff Darlington of ESPN.
Foster's health remains a question mark, but the 49ers are confident the young prospect will be an impact player on the defense as soon as he is ready to play. With contract issues now behind him, he will simply need to focus on returning to the field.
After a 2-14 season where they allowed the most points in football, San Francisco should be thrilled to add some much-needed talent on the defensive side of the ball.