Unai Emery's side were appearing in Europe for the first time since 2010-11, but went into their Group E curtain-raiser as favourites to go all the way and lift the trophy at the end of the season.
However, their quest to emulate West Ham United's success in the competition last term got off to the worst possible start as they fell to a chastening defeat in Poland.
All of the goals came in the opening 51 minutes - including four in the first half - as Legia took the lead three times and managed to hold on to it after Ernest Muci's 51st-minute strike.
The chaos began almost immediately after kickoff as Pawel Wszolek opened the scoring after only three minutes for the hosts, firing into the bottom corner from inside the box after being left free by some absent defending.
That lead lasted only three minutes before Jhon Duran restored parity with a header after Nicolo Zaniolo's thunderous strike came back off the crossbar, but Legia regained their advantage midway through the half when some more lackadaisical defending allowed Muci in for his first of the night.
This time the home side stayed ahead for 13 minutes, but Villa levelled things up once again six minutes before half time courtesy of Lucas Digne's deflected half-volley into the top corner.
The visitors could have gone into the break ahead as Leon Bailey and Duran both squandered presentable chances in the closing stages of the half, and Legia took full advantage of those let-offs to take the lead for a third time six minutes into the second half.
Muci was the hero as he carried the ball forward on the counter-attack, being allowed the space to get a shot away and duly drilling his effort in off the inside of the post.
Villa pushed for a third equaliser and created chances in the closing stages as Jacob Ramsey, Moussa Diaby and Youri Tielemans all should have done better, but they ultimately fell short as Legia held on for a famous win.
The other match in Group E also saw goals galore as Zrinjski Mostar beat AZ Alkmaar 4-3 in another eye-catching shock.