Bale gave the hosts the lead in the 16th minute with a curled left-foot drive and an own goal doubled their advantage.
Gareth Bale scored his first European goal in almost two years as holders Real Madrid moved into a commanding position in Champions League Group F after cruising to a 5-1 victory over Legia Warsaw on Tuesday.
Bale gave the hosts the lead in the 16th minute with a curled left-foot drive and an own goal by Legia's Tomasz Jodlowiec, deflecting in Marcelo's shot, doubled their advantage.
Miroslav Radovic pulled one back for the Poles from the penalty spot but Marco Asensio made it 3-1 in the 37th minute with a low shot on his Champions League debut.
Substitute Lucas Vazquez volleyed home a cross in the 68th minute and former Juventus striker Alvaro Morata rounded off the win by converting a pass from Cristiano Ronaldo in the 84th.
Real are second in Group F, level on seven points with Borussia Dortmund, and both teams will seal their place in the last 16 if Zinedine Zidane's side win at Legia and the Germans beat Sporting Lisbon at home on Nov. 2.
"I'm happy with the result, with the goals and the performance," Zidane told BeIN sports.
"Of course we can improve, our objective was to play very attacking football and we took risks, conceding a few chances, but the important thing was to win and accumulate points, and that's what we did."
There was trouble outside the Santiago Bernabeu stadium before kickoff on Tuesday, with five supporters and two police officers suffering minor injuries, according to local media reports.
On the pitch, Legia nearly caused the holders an early surprise with Jodlowiec shooting straight at Keylor Navas and midfielder Vadis Odjidja hitting the post.
Real took the lead soon after though, Bale cutting inside from the right to strike into the far corner for his first European goal since December 2014.
Jodlowiec turned in Marcelo's shot soon after but a foul by Real defender Danilo allowed Radovic to reduce the deficit from 11 metres and net Legia's first Champions League goal for 21 years.
Twenty-year-old winger Marco Asensio built on his impressive start to his Real career by netting his fourth goal of the season after being teed up by Ronaldo.
Ronaldo turned provider again by releasing substitute Morata for the fifth goal after Vazquez had lashed home the fourth.
The prolific Portuguese narrowly missed out on adding to his haul of 98 goals in European competition by striking wide of the far post.
"Ronaldo played phenomenally, playing passes to everyone else," added Zidane.
"He didn't score today but we have a game in four days' time (against Athletic Bilbao) and I'm sure he'll have chances to score then."