The 22-year-old, who forced his way into the first team before suffering a long-term injury earlier this season, has admitted that this new deal has given him the incentive to come back "stronger" from his injuries.
"Being a Liverpool supporter myself, it's brilliant to put the shirt on and I'm doing what I have loved doing since I was a kid," Kelly told the club's official website. "I'm over the moon.
"Today shows the faith that the club have in me and that the hard work I have put in since I was young has paid off. Hopefully I'll put the injuries behind me. We have excellent medical staff here, who are going to work me and keep me on top of my injury. I'll be coming back even stronger."
Managing director Ian Ayre added: "I think everybody has been starting to see and enjoy Martin's potential and the work he has showed to get into the first team and these are the things we are looking for.
"He was very unfortunate to get his injury but he has worked very hard with the physios and the medical team and hopefully we'll see him back soon. Signing him up for the long term is very important for us."
Kelly, who has racked up 54 appearances for the Reds, is a product of the Premier League club's youth academy.