SAN FRANCISCO — Alex Smith threw a 59-yard touchdown pass to Vernon Davis in what likely was the quarterback's final hurrah with the 49ers, and San Francisco beat Arizona 38-7 on Sunday in a matchup for last place in the awful NFC West.

Smith, the 2005 No. 1 overall draft pick who becomes a free agent, threw for 276 yards and two TDs overall and the Niners (6-10) made interim coach Jim Tomsula a winner in what will probably be his only game coaching the team. Tomsula was promoted from his defensive line duties after coach Mike Singletary was fired following a loss last week.

Larry Fitzgerald had a 10-yard TD reception from John Skelton among his 11 catches for Arizona (5-11).

Brian Westbrook had a pair of 6-yard TD runs in the third quarter for San Francisco.