The 29-year-old had fallen out of favour at Anfield and was linked with Barcelona and Napoli but has opted to return to his former club in Denmark.
Agger, who has played 232 times for Liverpool since joining from Brondby in 2006 for £5.8million, has struggled to secure a place in Brendan Rodgers' side and the recent £20million signing of Dejan Lovren has convinced him to move away from Anfield.
Agger told the club's website: "Liverpool have been such a big part of my life and my family's lives for so long, that leaving is extremely difficult.
"The opportunity arose for me to return home to Brondby and at this stage of my career it felt like the right decision for me.
"I wouldn't leave here to go anywhere else and that has been proven by my actions in recent seasons - I have turned down many offers to move to other Premier League and European clubs.
"I would like to thank the Liverpool supporters for the incredible backing they have given me in my time here and the warmth and generosity of spirit displayed to my family.
"This has been our home and somewhere we have been very happy and settled. However, more recently I have started to feel the effects of playing regularly in a league that is as physically demanding as the Premier League is, and I would not want to stay if I did not think that I was able to meet that challenge week in, week out.
"The club itself is very special and I shall remain a supporter for the rest of my life. I regard every game I played at Anfield as a privilege."
Liverpool boss Rodgers added: "We wish Daniel and his family well for the future. We've been discussing Daniel's future with him during the close season and I know this is a decision he has reached after much soul searching and deliberation.
"Daniel loves Liverpool and the club's supporters, and has a unique connection with them.
"On behalf of everyone at Liverpool, I thank Daniel for his service to the club and hope he finishes his career with some happy times in Denmark."