Miley, 20, joined the Newcastle United academy at the age of seven and has broken a series of club records in the three years since his senior debut.
He is the club's youngest ever appearance-maker, goalscorer and assist provider in both the Premier League and the Champions League, and earlier this season scored a header at Bayer Leverkusen to break Hugo Viana's Champions League record that had stood since 2002.
He made 34 appearances this season in a campaign disrupted by injury, recording three goals and four assists after adapting seamlessly to a new right-back role alongside his natural central midfield position. His total of 80 appearances for the club in all competitions already places him among the more experienced young players in the Premier League.
"I'm really pleased to sign this new contract and commit my future here. It's a dream to be representing Newcastle United, so this is a proud moment for me," Miley said.
"I'm really grateful to everybody who has played a part in helping me get to where I am today, especially the support of my family and the trust that the club has put in me from such a young age. I'm now working hard every day to get back on the pitch even stronger next season."
Manager Eddie Howe added: "Lewis fully deserves his new contract as recognition for everything he has achieved over the last few years. He's earned every opportunity and has proven himself to be more than capable of performing at the highest level. His versatility has proven to be a major plus and his willingness to try new roles is a reflection of his selfless approach to the team."
Sporting director Ross Wilson described the deal as something the club had been working on quietly for several months.
"Lewis already had a long contract with us, but we felt it was important to reward his continued progression and development. The most exciting aspect is that we believe the best is still to come."
The extension arrives amid speculation linking Miley with a summer exit. Manchester United had been tracking his situation, and his profile as a technically accomplished, versatile ball-carrier has attracted attention from several clubs. The new contract ends that conversation entirely โ at least for now.
