Real's task appeared to have been made much easier after Atalanta's Remo Freuler was sent off in the 17th minute for denying Mendy a goal-scoring opportunity.
- Real Madrid ratings: Mendy 8/10 brings relief to Zidane's side
Against the 10 men, however, Zinedine Zidane's side, who were missing several high-profile players through injury, struggled to break down the hosts, and Real had only one shot on target in the rest of the first half.
"It was hard for us, but it's a good result in the end. We didn't play a great game, ten against eleven, but in the end it's an important result, an away goal. It's a good result but we'll have to play and win the second leg," Zidane said after the match.
Marcotti: Atalanta will regret not going for it vs. Real Madrid
Gab Marcotti says Atalanta will rue not throwing numbers forward following their 1-0 defeat vs. Real Madrid.
Atalanta continued to defend doggedly after the interval, but Mendy's superb strike in the 86th minute gave the record 13-times European champions a slender lead to take into the second leg.
Gian Piero Gasperini's Atalanta shocked everyone by getting to the quarterfinals last year in their first season in Europe's premier competition, especially given they played all their home games at the San Siro in Milan while their own stadium was being re-developed.
Now back at their ground, Atalanta's first Champions League knockout match in Bergamo got off to a bad start when the referee showed no hesitation in sending Freuler off for bringing down Mendy when he was through on goal.
Half chances for Luka Modric and Vinicius Jr. were all they could come up with as the game entered the latter stages.
"Today it was a bit uncomfortable, we couldn't find the spaces ... The most important thing for us is the result. The plan changed [with the red card]," Zidane said.
It was going to take something special to breach the well-organised home side and full-back Mendy provided it with a 25-metre strike, his first Champions League goal.
"I wasn't expecting such a quiet night in goal, but we defended well, obviously the red card meant that they couldn't attack so much, but it was a complicated game, they played with ten men behind the ball, on the counter attack, it was hard to find the gaps. In the end it was a great goal from Mendy and a victory to take back to Madrid," keeper Thibaut Courtois said.