15 minutes after the restart, Barca were on the verge of scoring the opener after Sergi Roberto was fouled by Esteban Granero in the box.
Espanyol had never beaten Barcelona in their new stadium before, the last time they won a home game against Barcelona was in 2007 when current Barcelona manager Ernesto Valverde was their manager. It was Lionel Messi who took it, but he was denied off by a wonderful save by the goalkeeper Diego Lopez.
The Blaugrana secured a breathtaking 8-0 win over Real Murcia over two legs in their first Copa del Rey fixture of the season, with an aggregate 6-1 thumping of Celta Vigo helping Valverde's side reach the quarter-finals.
The second leg takes place at the Nou Camp on Thursday, 25 January.
The Barcelona Derby doesn't exactly set pulses racing outside of Catalonia as FC Barcelona's dominance over RCD Espanyol has been pretty thorough dating back to 1928.
"We played with the same players in Vigo [against Celta] and I am happy with them", the coach said.
Arsenal to make cash and player offer for Aubameyang
Aubameyang has now agreed personal terms with Arsenal , with the Dortmund talisman desperate to force through a move this month. Gary Neville says that he can not understand Manchester City's "economics" in their thinking over the Alexis Sanchez situation.
Gerard Pique has called for better behaviour from fans in the second leg of Barcelona's Copa del Rey tie with Espanyol after some unsavoury incidents in Wednesday's match.
"I congratulate them and we'll meet again in a week's time".
Costa put Atletico ahead in the 73rd minute only for goalkeeper Miguel Angel Moya to inexplicably push a speculative cross that deflected off defender Lucas Hernandez into his own net.
The result ended Atletico's four-game winning run.
However, it was Espanyol who bagged the game's only goal in the 88th minute courtesy of a strike from Melendo, 1-0.