Michael Crabtree will try to salvage his NFL career by switching teams while remaining in the San Francisco Bay Area.

The free-agent veteran wide receiver has agreed to a one-year contract with the Oakland Raiders, the team announced Monday. The deal is for $3 million with an additional $2 million in incentives, a league source told ESPN NFL Insider Adam Schefter.

Crabtree, the San Francisco 49ers' No. 10 pick of the 2009 draft, confirmed his decision on Twitter.

It's official.. I'm a Raider — Michael Crabtree (@KingCrab15) April 14, 2015

Crabtree's production waned last season, and he appeared to lose explosiveness after a 2013 Achilles injury that caused him to miss most of that season. Crabtree has had just two 100-yard-receiving games in the 24 games since his return from the injury, and despite playing in all 16 games in 2014, he dealt with nagging foot injuries. His highest-yardage total in a 2014 game was 85 yards, and he had 68 catches.

Crabtree, 27, has a chance to be a starter for Oakland, which badly needs receiving weapons for second-year quarterback Derek Carr. The Raiders tried to sign big-ticket free agents Randall Cobb (Green Bay) and Jeremy Maclin (Kansas City), yet they are settling for Crabtree nearly five weeks into free agency.

The Raiders still could take Alabama receiver Amari Cooper or West Virginia receiver Kevin White with the No. 4 pick in the NFL draft, which begins April 30.

Six-year veteran Michael Crabtree is leaving the 49ers, having agreed to a free-agent contract with the Raiders. Ezra Shaw/Getty Images

Even after saving a game for the Niners with a late 51-yard catch on fourth-and-10 at New Orleans last season, Crabtree derisively referred to himself as a third-down receiver or a fourth option. And after entering the season with a 12.9 yards-per-catch career average, he averaged a career low, which would have been 9.7 yards without the 51-yarder at the Superdome.

Crabtree caught four touchdown passes, the third-highest single-season total of his career. And according to Pro Football Focus, the 49ers' 91.1 passer rating when targeting Crabtree was third-best on the team, behind Anquan Boldin (103.5) and Stevie Johnson (102.0).

ESPN 49ers reporter Paul Gutierrez contributed to this report.