The 21-year-old, who is with the Wales set-up ahead of Wednesday night's friendly against Australia, was an integral part of the squad that secured promotion last term.
Confirmation of his new deal comes just a day after captain Garry Monk agreed a three-year contract, while the likes of Angel Rangel, Andrea Orlandi and Neil Taylor have also put pen to paper on new contracts during the course of the summer.
Allen told the club website: "The fact that the manager and the club wanted to re-sign me and for such a long length of time is pleasing.
"They have shown a lot of faith in me and I am flattered."
Manager Brendan Rodgers had said in a radio interview last month that Allen had agreed his deal, but the diminutive playmaker only signed the new contract on Wedneday.
Allen made his debut in a 6-3 defeat to Blackpool in League One four years ago and, having played a part in two promotion campaigns, cannot wait to test himself in the top flight this season.
He added: "The club has always moved forward during my time here and it shows how far we have come when we kick off the season at Manchester City in the Premier League.
"Technically, Man City are very good, but they are probably also the biggest side physically in the league. I have been in the gym all summer trying to bulk up, but I think I've got a long way to go.
"But we've all got to stand up and be ready.
Source: PA
Source: PA