Terms were not disclosed.
The move reunites Hayward with Raiders defensive coordinator Gus Bradley, who was his defensive coordinator with the Los Angeles Chargers the past four seasons. The Raiders hired Bradley as their defensive coordinator in January.
The Chargers released Hayward in March, ending his five-year run with the franchise.
Hayward, 31, appeared in 14 games last season, making 13 starts. He finished with an interception and eight passes defended. He was inactive for the Nov. 29 game at Buffalo, snapping a streak of 107 consecutive games played.
During his five seasons with the Chargers, Hayward had 66 passes defensed, which led the AFC during that span. He led the NFL with seven interceptions in 2016 and was selected to the Pro Bowl in 2016 and 2017.
The Raiders hope he can regain his old form and bring a steadying influence to a young secondary. The Raiders had been projected to start players taken in the past three drafts with cornerbacks Trayvon Mullen, Damon Arnette and Amik Robertson in the slot and safeties Johnathan Abram and 2021 second-round pick Trevon Moehrig.
Arnette struggled as a rookie last season after being drafted in the first round and Hayward provides an option to start outside at cornerback if Arnette doesn’t improve or moves into the slot.
Hayward spent the first four seasons of his career with the Green Bay Packers, who selected him in the second round of the 2012 draft. He has 23 interceptions, 100 passes defended and 385 tackles in nine NFL seasons.
The Associated Press contributed to this report.