The defender, who is celebrating his 18th birthday today, came through the Saints' youth system and made his senior debut for the club last year.
He told the club's official website: "I'm very pleased to have finally signed it. I committed myself back in January, and I'm glad everything has been sorted out.
"I've been getting a lot of questions about my future, but all of the Saints fans will have known that I committed my future in January.
"I've been here since I was eight and I've loved every single moment of it. I want to stay at this club, and signing this contract means I'm here for another five years."
Shaw made 28 appearances in all competitions for Southampton last season.