49ers All-Pro linebacker Patrick Willis left Sunday's game against the St. Louis Rams with a right hamstring injury and did not return.