Silva arrives as part of a flurry of summer transfer business for Madrid, who recently hired Jose Mourinho to oversee the upcoming season.
"Real Madrid CF and Bernardo Silva have reached an agreement whereby he will be a Real Madrid player for the next two seasons, until June 30, 2028," they said in a statement.
Madrid have already confirmed the signing of Premier League left-back Marc Cucurella, and are expected to add further bodies - including Liverpool defender Ibrahima Konate, also on a free transfer.
Silva arrives in a time of change at Madrid, who have hired Mourinho to steady the ship after turmoil under Xabi Alonso and Alvaro Arbeloa.
He enjoyed supreme levels of success at Manchester City, featuring 460 times and contributing with 76 goals and 77 assists.
The midfielder won everything available to him during his time in England, including six Premier Leagues and the Champions League.
