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."
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
Luck Recommends His Favorite Reads in Virtual Book Club
The Best Moments from NFL Training Camps
Celebrate Your Favorite SB Snack on National Chicken Wing Day
Who Had the Best Camp Entrance This Year? 🚁
From Working Odd Jobs to the NFL
Kamara Is Taking on All Comers in Paintball
There's No Offseason for NFL Workout Warriors
Norman Goes on Shopping Spree for Detained Families
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.