ESPN Chiefs reporter Adam Teicher says the good work Kansas City did at the start of free agency was negated by the loss of CB Sean Smith to the Oakland Raiders. (1:08)

Chiefs will remember Sean Smith as the one who got away (1:08)

Cornerback Sean Smith and the Oakland Raiders have reached an agreement on a four-year, $40 million contract, a source told ESPN NFL Insider Adam Schefter, confirming multiple media reports.

Smith will receive $20 million guaranteed on this deal, the source said.

Smith, who has already changed his Twitter avatar to include a Raiders background, tweeted about his agreement on Thursday.

I'm goin goin, back back, to Cali Cali 😎✌🏾️ — Sean Smith (@SeanSMITH24) March 10, 2016

He joins the Raiders after three seasons with the Kansas City Chiefs. His value to the Chiefs was evident in the way Kansas City's defense improved shortly after his return to the lineup following his three-game suspension to start the season. The Chiefs allowed more than 30 points in two of their games without Smith and in the first one after his return, but they allowed more than 20 just twice in the 14 games that followed, including the playoffs.

The 28-year-old Smith was a steady presence in Kansas City's pass defense and provided a nice complement to fellow starting cornerback Marcus Peters, who made more big plays but took far more risks than Smith.

Smith had two interceptions in the regular season and then had one of the Chiefs' four interceptions of quarterback Brian Hoyer in their wild-card victory over the Houston Texans.

Smith's three-game suspension was for a violation of the NFL's substance-abuse policy. It stemmed from a DUI case in Kansas City in which Smith pleaded guilty.

He played the first four seasons of his career in Miami after the Dolphins selected him in the second round of the 2009 draft.

ESPN Chiefs reporter Adam Teicher contributed to this report.