Vinicius Junior opened the scoring for the hosts just before the half-hour mark.
Marco Asensio quickly added the second few minutes later to give Real Madrid a 2-0 lead going into the break as Liverpool failed to muster any shot in the first half.
Mohammed Salah reduced the deficit six minutes after the restart to give Liverpool a glimmer of hope.
The visitors poor defensive showing cost them dearly as they allowed Vinicius to add the third goal to earn Real Madrid a vital 3-1 win going into the second leg.
Manchester City earned a 2-1 win over Dortmund at the Etihad Stadium courtesy of goals from Kevin De Bruyne and Phil Foden.