Reliever Edward Mujica and the Boston Red Sox have agreed on a two-year, $9.5 million deal, sources told Yahoo Sports.

The deal is pending a physical, which Mujica is taking Thursday.

Mujica spent almost all of last season as closer for the St. Louis Cardinals before losing his job to Trevor Rosenthal in September. The 29-year-old right-hander saved 37 games with a 2.78 ERA for the Cardinals. Late-season struggles ballooned his ERA by more than one point, and the Cardinals used him just twice in the playoffs – and not at all against Boston in the World Series.