* Pepe header secures 1-0 win at Cornella-El Prat
* Real three points behind leaders Barca, Atletico (Adds quotes, late result, byline)
By Iain Rogers
MADRID, Jan 12 (Reuters) - Real Madrid closed to within three points of La Liga leaders Barcelona and Atletico Madrid at the halfway stage of the season when a Pepe header secured a laboured 1-0 win at mid-table Espanyol on Sunday.
Barca and Atletico drew 0-0 in Saturday's top-of-the-table clash at the Calderon and Real took full advantage to move on to 47 points from 19 matches, with the leaders tied on 50 and champions Barca ahead on goal difference.
It was hardly a vintage performance from Real at Espanyol's Cornella-El Prat stadium in Barcelona, with the likes of Cristiano Ronaldo, Gareth Bale and Karim Benzema well below their best.
It was left to Ronaldo's Portugal team mate Pepe to grab the only goal of a tepid contest when the centre back was left unmarked in the 55th minute and headed a Luka Modric free kick into the net.
Espanyol barely troubled Real keeper Diego Lopez and Real should have doubled their lead late on when Ronaldo, favourite to scoop the FIFA Ballon d'Or award when the winner is announced on Monday, sliced a shot wide with the goal at his mercy.
Real coach Carlo Ancelotti said that with the top three teams unlikely to slip up more than a couple of times his side would have to avoid dropping as many points in the second half of the campaign to have any chance of winning the title.
Real lost 1-0 at home to Atletico in September and went down 2-1 at Barcelona in October's 'Clasico' and also drew at Osasuna and Villarreal.
Real's last La Liga title under Ancelotti's predecessor Jose Mourinho in the 2011-12 season was won with a record 100 points, as was Barca's last term under Tito Vilanova, their fourth in five years.
"This situation is not normal but this is the Spanish league where there are three very strong teams," the Italian told a news conference.
Commenting on Sunday's match, Ancelotti added: "It was a key moment as Atletico and Barca are playing well and there are not many chances to cut the gap.
"We started slowly and suffered in the first 15 minutes but later we had a lot of chances and after the goal we controlled the game well.
"I am satisfied because I think the team had balance and played some good football."
The woes of bottom side Real Betis deepened when they were beaten 2-1 at home to Osasuna as both sides had a player sent off and Betis forward Ruben Castro missed a penalty.
Rayo Vallecano, one place above Betis in 19th, pulled five points clear of the struggling Seville-based side, level on 16 with Real Valladolid, thanks to a 1-0 win at Madrid-based rivals Getafe.
Malaga's stuttering season continued under German coach Bernd Schuster, who replaced Manuel Pellegrini when the Chilean moved to Manchester City at the end of last season, when they lost 1-0 at Levante.
Qatar-owned Malaga, who reached the last eight of the Champions League last season, are 14th on 20 points, while Valencia-based Levante climbed to 10th, one of four teams on 23 points along with Valencia, Granada and Getafe. (Editing by Toby Davis)