The Polish side’s Brazilian winger Luquinhas scored the first goal of the match in the remote Arctic Circle town of Bodø, in Norway's far north, in the 2nd minute, and Mahir Emreli, an Azerbaijani, doubled the score in the 41st.
Emreli in the 89th minute converted an assist from Polish midfielder Kacper Skibicki into a third goal for Legia.
The goals for the Norwegian champions, meanwhile, came from Erik Botheim in first-half stoppage time and Pernambuco in the 78th minute.
Legia Warsaw play Bodø/Glimt in the second leg next Wednesday, July 14, in Warsaw, with kick-off at 8 pm.
The winner of the two matches will go on to face either Estonian side Flora Tallinn or Malta's Hibernians in the second round of Champions League qualifiers.
The loser will be relegated to the lower Europa League, but will be granted a bye into the third round of qualifiers of the latter.
To qualify for the Champions League group stage, Legia need to eliminate Bodø/Glimt and three other rivals, the PAP news agency noted.
Legia in May won the Polish premier league championship for the 15th time.
Legia Warsaw players with coach Czesław Michniewicz (centre) during a training session last month. Photo: PAP/Leszek Szymański
The Polish side qualified for the group stage of the 2016/2017 Champions League and drew 3-3 with Spain's Real Madrid in November 2016.
Legia later that month lost 4-8 to German side Borussia Dortmund in the highest scoring match in Champions League history.
(gs/pk)
Source: PAP