•The deal for the Scotland Under-21 player also includes £2.5m of potential add-ons and a 17.5% sell-on clause.
•There are no plans to send Ramsay on loan and he will join up with Jurgen Klopp's first team for pre-season.
Calvin Ramsay, who has been capped three times by Scotland Under-21s, will wear the number 22 shirt for Liverpool
Liverpool have completed the signing of 18-year-old Scottish right-back Calvin Ramsay from Aberdeen on a five-year deal for an initial £4.2m.
The deal for the Scotland Under-21 player also includes £2.5m of potential add-ons and a 17.5% sell-on clause.
There are no plans to send Ramsay on loan and he will join up with Jurgen Klopp's first team for pre-season. "I'm just buzzing and it's a dream come true really to be here," the defender said.
"It was a dream come true to play for Aberdeen, and now to be at one of the biggest, if not the biggest club in the world, it's a massive achievement and I'm looking forward to trying to show the fans what I've got."
Ramsay made 33 appearances for Aberdeen last season, scoring one goal and registering nine assists.
He has made 39 appearances in total for the Scottish Premiership side after rising through the youth ranks.
The full-back was named young player of the year by the Scottish Football Writers' Association in April after an impressive breakthrough campaign that saw him linked with a host of European clubs.
Ramsay said the development of young players, such as Trent Alexander-Arnold and Harvey Elliott, was one of the reasons he joined the Reds. "There's obviously a pathway here," he said.
"That's one of the reasons I chose it as well. It's not just a massive club, they give young players chances in the first team.
"So if I can come in in pre-season, put my mark down, then there's no reason why I can't push to get in the first-team squad."
He is Liverpool's third arrival this summer following £64m Uruguay striker Darwin Nunez from Benfica and £5m Fulham forward Fabio Carvalho.
Liverpool won the Carabao Cup and FA Cup last season, but were runners-up in the Premier League and lost the Champions League final to Real Madrid.
Liverpool manager Jurgen Klopp said he was looking forward to working with "another young player" who has "bags of potential".
"He is only 18 years old at the moment, although he turns 19 soon, and already has a decent number of first-team appearances for a defender his age," Klopp said.
"He is athletic, smart, confident, with good technical ability and, always crucial, is eager to learn. So there are lots to like.
"Experiences of European and under-21 international football have been really important for him and his development."
Klopp says Liverpool are the right club to nurture Ramsay's talent and that signing so early in the transfer window will allow him to settle into the squad during pre-season.
"He and we will have patience with each other. I think we have proved ours is the ideal environment to nurture and harness the qualities and talent of a young player," the Reds boss added.
Ramsay is a player who passes the scouts' mythical 'eye-test'. A modern attacking full-back, he looks comfortable on the ball, is strong with both feet, and his dribbling ability draws fouls.
A few months ago, Aberdeen posted a clip of Ramsay scoring from 30 yards with his weaker left foot while playing for the youth sides, and another of him as a 13-year-old performing an array of skills in his garden.
His sole first-team goal - against Dundee in April - was in a similar vein as he cut infield onto his left foot and lashed in a 20-yard strike.
He contributed four league assists in a struggling Aberdeen team last season— only four non-Old Firm players produced more —and created an average of 1.58 chances per 90 minutes.
Despite all the positives, there is plenty to work on, as one might expect for an 18-year-old. Defending crosses to the back post is a vulnerability and, while not slight, he is still developing physically.
He does not have the same presence as fellow Scottish right-back Nathan Patterson, who moved to Everton in January and is two years older.