La Liga leaders Barcelona slumped to a shock first loss of the season on Wednesday, suffering a 2-1 defeat at struggling Leganes after conceding twice in two second-half minutes as coach Ernesto Valverde's squad rotation backfired.

Philippe Coutinho gave the champions the lead in the 12th minute with a classy volley and Lionel Messi smacked a shot against the bar as Barca, resting Jordi Alba and Luis Suarez, made a strong start against Leganes, who began the game bottom of the table.

Barca's comfortable hold on the game dramatically fell apart shortly after the interval when Nabil El Zhar headed home a looping cross in the 52nd minute and 20-year-old Oscar Rodriguez turned in a second goal barely sixty seconds later to the joy of the 12,000 fans crammed into the Butarque stadium.

Leganes goalkeeper Ivan Cuellar pulled off a stunning double save to thwart Coutinho and Ivan Rakitic from close range in the closing minutes while Sergi Roberto skied a good opportunity as the unfancied hosts held on to record their first top-flight win over Barcelona.

"There are no excuses today," Barca midfielder Sergio Busquets said.

"The worrying thing is conceding so many goals. We have to be more solid. It’s a really negative result."

Barca remained top of the standings but could slip three points behind Real Madrid into second spot if Julen Lopetegui's side win at Sevilla later on Wednesday.

The Catalans were playing a fourth game of a hectic spell of seven matches in 23 days and even though they drew 2-2 at home to Girona after Valverde rested players, the coach rotated his side again, bringing in Thomas Vermaelen for Alba to deploy an unfamiliar back three.

He also started without Suarez to give forward Munir El Haddadi a first competitive start since returning on loan from Alaves and Barca lacked fluidity up front even though they took the lead when Coutinho received a crossfield pass from Messi and flicked the ball into the air before volleying home.