Leeds United
During the 2010–11 season, O'Brien picked up a hamstring injury for Bolton in the Premier League game against Aston Villa. O'Brien joined Leeds United on an initial one month's loan on 29 October 2010. Manager Simon Grayson said of the move "Andy has had a fantastic career, and has great experience. He's a leader and will be a valuable member of the squad for the next [month]." The move saw O'Brien re-join the club he started his career at, he was released by Leeds 17 years earlier as a 14-year-old. O'Brien was given squad number 40 and made his debut for against Scunthorpe United. In November 2010, O'Brien revealed that he would be interested in possibly making his loan move to Leeds permanent. O'Brien scored his first goal for Leeds with a header against Hull City. On 24 November, the loan was extended until 4 January 2011.
After a two-game spell on the sidelines with injury, O'Brien returned to Leeds' starting lineup against Leicester City. O'Brien scored two own goals against his former club Portsmouth. On 30 December, manager Simon Grayson confirmed he wanted to sign O'Brien permanently. O'Brien was also subject of interest from Cardiff City.
On 1 January 2011, O'Brien signed a permanent deal with Leeds United on a 2+1⁄2-year contract, which took effect after his loan deal came to an end on 4 January 2011. He turned down a lucrative offer from Cardiff City, opting to move permanently to Leeds. On 8 January, O'Brien put in an impressive performance to help earn Leeds a 1–1 draw against Arsenal, Leeds were 1–0 up when Robert Snodgrass scored a second half penalty, Arsenal equalised in the 90th minute when Cesc Fàbregas scored a penalty. O'Brien picked up an injury in the FA Cup replay against Arsenal and subsequently missed the game against his former club Portsmouth. O'Brien scored his second goal for Leeds in the 3–2 loss against Millwall.
After picking up a hip injury during the 2011–12 pre-season he missed all the pre-season games, to return against his former club Newcastle United. Then stepped up his recovery against Leicester City in a behind closed doors friendly. The summer also saw O'Brien take the number 5 shirt after previously occupying the number 40 shirt. O'Brien started for Leeds the opening day of the season as they crashed to a 3–1 defeat against Southampton, with O'Brien at fault for the second goal when his backwards header was converted by Adam Lallana. He was given a torrid time against his former club Bradford City and was substituted to loud jeers in the second half with Leeds 2–1 down. Leeds went on to win the game 3–2. O'Brien dropped out of the Leeds squad for the following game on 13 August against Middlesbrough in a match Leeds lost 1–0.
After nearly three months out of the side, O'Brien returned to the Leeds team due to the suspension and injury of Tom Lees and Darren O'Dea and helped Leeds keep a clean sheet against Leicester City on 6 November. O'Brien was linked with a loan move to West Ham during November, however manager Simon Grayson revealed he wasn't looking to send O'Brien out on loan.
After Leeds 2–1 win against Burnley on 19 November, manager Simon Grayson revealed post match, that O'Brien had come to him the day before the game and refused to play for Leeds ever again. Grayson subsequently stated that O'Brien's career at Leeds was now over due to his refusal to play, however, it later emerged O'Brien's refusal to play was down to the fact he was at time suffering from depression and was "not in the right state of mind" when he stated he would no longer play for Leeds. After manager Simon Grayson was sacked, O'Brien played his first game for Leeds as a substitute against Coventry City.
He was transfer listed by Neil Warnock at the end of the 2011–12 season and told to find a new club. On 4 May 2012, O'Brien lost his squad number, when the number 5 shirt previously occupied by him was given to new signing Jason Pearce.