Wawrinka, who lost to Rafael Nadal in last year's final and won the 2015 title, was beaten in a five-set thriller 6-2, 3-6, 4-6, 7-6 (7/5), 6-3 by the Spanish world number 67 on Court Suzanne Lenglen.
The 33-year-old has been plagued by a knee injury and arrived at Roland Garros having won just one match on clay in Geneva last week, his first event in three months.
The defeat means that the three-time Grand Slam champion will slip from 30th in the world to outside the top 250 after the tournament, having failed to defend the ranking points he gained in 2017.
There were worrying signs for his fans when he pulled up with the same left knee injury that has plagued him in recent months and called for a medical timeout after just six games.
The 23rd seed looked to be really struggling as he quickly dropped the first set, but found his rhythm from nowhere in the second, crunching two massive forehands to break for a 3-1 lead.
A fired-up Wawrinka duly levelled the match, having saved a break point in the seventh game thanks to some magnificent defending in a brutal rally under the Paris sunshine.
Wawrinka saved a break point to serve out the third set after breaking in the opening game, as 34-year-old Garcia-Lopez threw his racket to the ground in disgust.
The match looked to be all but over when Wawrinka broke in game five of the fourth set, but he became ragged and Garcia-Lopez forced a decider by edging a tie-break.
Wawrinka's form totally deserted him in the fifth set, and Garcia-Lopez comfortably wrapped up victory.
Elsewhere in the men's draw, Argentinian Marco Trungelliti saw off Bernard Tomic 6-4, 5-7, 6-4, 6-4, just 11 hours after arriving in Paris after driving back from Barcelona to take a lucky loser's spot on Sunday night.
The world number 190 was a record eighth player that lost in qualifying to take a place in the main draw.