The Rams announced Thursday the team has agreed to terms with Barwin.
Barwin was released by the Eagles last week.
He played four seasons for the Eagles after spending the first four in Houston. He had 14 1/2 sacks in 2014 and went to the Pro Bowl.
But Barwin had 12 sacks combined over the past two seasons and struggled last year when he moved from linebacker to the defensive line after the Eagles switched to a 4-3 system.
Barwin started all 64 regular-season games in his four years with the Eagles and left Philadelphia tied for 13th in team history with 31 1/2 sacks.
Eagles Executive Vice President of Football Operations Howie Roseman released a statement about Barwin's departure, which read:
"Connor Barwin is a tremendous teammate, player and an even better person. He represented the Philadelphia Eagles with class and integrity for the past four seasons and we appreciate his efforts both on and off the field. It's rare to come across a player who invests so much of himself in the locker room, as a leader on the field, and with his relentless work ethic. His work in the community will have a lasting impact on our city that we can all be very proud of. Obviously this was a difficult decision for us but we wish him and his family all the best. On behalf of all of us we just wanted to say thank you and we all hope that our paths cross again in the future."
As for Barwin, he posted a message to his fans and the city, saying: "Thank you Philadelphia from the bottom of my heart for welcoming me and for being the amazing."
Barwin followed that up the next day with another post: "Yesterday was tough but thanks Philadelphia for all the love and support. The future is bright! Onward and upward!!!"
The Associated Press contributed to this report.