In making the move the 26-year-old ends a 13-year association with Villa. He made 122 appearences for the side after making his debut in 2011.
Baker is no stranger to Ashton Gate, having spent the 2015/16 campaign on loan there, making 38 appearances.
Despite making 34 appearances for Villa last season, the arrivals of John Terry and Chris Samba have pushed Baker further down the pecking order and he has decided to move on as he looks to continue playing regularly.
Baker insisted that the decision to join City was a 'easy' on, telling the club's website: "I’m delighted to come back."
“When Bristol City put the offer in it made me feel good about myself again."
“I spent a long time of my career at Villa but it feels like the right time to move on with Bristol City."
“It helps that I know the club already, but the main thing for me is the potential of the club – it was an easy decision for me.”
The signing comes at a good time for the 'Robins' with reports suggesting that Bristol City may be about to lose a centre-half with Middlesbrough being linked with a player-plus-cash bid for defender Aden Flint.