Martz was let go Tuesday by Mike Singletary, who was made the permanent head coach of the team Sunday night after going 5-4 as the interim coach.
Upon taking over, Singletary benched J.T. O'Sullivan, Martz's chosen quarterback, and installed Shaun Hill at the position.
The 57-year-old Martz coached the Rams from 2000-2005, taking a medical leave after five games in his final season because of heart problems.
The 49ers have had several different offensive coordinators over the last four seasons. Some have raised concerns that that has hampered the development of some players on the team.
He coached the Rams to the 2002 Super Bowl and was the offensive coordinator of the St. Louis team that won the 2000 title with "The Greatest Show On Turf."
He was offensive coordinator of the Detroit Lions in 2006-2007.