He started his career with then Championship side Cardiff City where he spent six years. He helped the club to the FA Cup Final in 2008 and to the Championship play-off final in 2010. In 2010, he moved to Celtic on a free transfer. He won the Scottish Premier League title in his second season with the club in 2012 and both the league and the Scottish Cup in 2013. He signed for Crystal Palace in January 2014 and played three and a half Premier League seasons for them.