City announced the signing of the defender from Real for a reported fee of £26.5 million.
The 26-year-old Brazil international, agreed a five-year contract with City and joins subject to a work permit.
Danilo told City’s official website: “I am very, very happy to have joined Manchester City.
“There has been strong interest from other clubs, but it has always been my ambition to play for Pep Guardiola.
“As soon as I heard of his interest, I knew immediately I wanted to be a City player. I can’t wait to get started and I’m looking forward to getting to know my new teammates over the coming weeks.”
Also City director of football Txiki Begiristain added, “Danilo is a fine player who offers great versatility to our squad.
“He can operate in several different roles in both defence and midfield, increasing Pep’s options ahead of the new season.
“We feel he has all the attributes needed to succeed at City and we look forward to helping him develop during his time here.”