Madrid had too much firepower as Gareth Bale, a Tomasz Jodlowiec own goal and Marco Asensio handed the hosts a comfortable half-time lead despite Miroslav Radovic’s penalty.
Lucas Vazquez and Alvaro Morata came off the bench to round off the scoring after the break.
Dortmund beat Sporting Lisbon 2-1 in the other game in the group, meaning Madrid and the Germans remain tied at the top of the pool on seven points.
FP: @realmadrid 5-1 @LegiaWarszawa (Bale 16', Jodlowiec (gpp) 19', Asensio 37', Lucas Vázquez 68', Morata 84'; Radovic 22' (p)).#RMUCL pic.twitter.com/KwowdFBqTR
— Real Madrid C. F. (@realmadrid) October 18, 2016