But complacency set in, and Girona took full advantage as Cristhian Stuani scored a penalty and Portu nodded in at the back post, leaving the European champions scrapping even for a point before Sergio Ramos was sent off in the 90th minute.
The hosts coasted through the first half, with Casemiro scoring the opener after 26 minutes, powering home a header from a Toni Kroos cross.
But when Ramos attempted an overhead kick in stoppage time, the referee had no choice but to award a second booking after it appeared he had kicked a Girona defender in the head.
Portu gave the visitors the lead 10 minutes later in front of a shocked Bernabeu, and despite a late surge which saw Real come close from a header by goalkeeper Thibaut Courtois, who was up for an injury-time corner, Santiago Solari's side couldn't find a way through.
He will receive a one-match ban, which will be served in the La Liga game away to Levante on February 24 and leave him free to play in the back-to-back Bernabeu Clasicos in the Copa del Rey on February 27 and La Liga on March 2.
All that changed in the second half, though, as Girona equalised from the spot.
He's been one of the standout performers, too, captivating Real's supporters with a string of eye-catching, confident displays.
For the third time in a month, Real Madrid faces Girona.
Madrid had won seven of its last eight matches in all competitions, with the only setback a 1-1 draw at Camp Nou in the first leg of the Copa del Rey semifinals.
Despite controlling most of the possession, as well as shots on target Madrid, were unable to hist back against Girona's surprise attack. Lozano's curling shot is saved by Courtois and Portu was quickest to the rebound to squeeze the header home at the near post.
"Solari's answer against Girona was to send Bale on for Marco Asensio, playing the Welshman on the right after being received by the Santiago Bernabeu with some murmur, and he went on to play without the desired spark", the publication continue.
After a sticky spell under Solari, Madrid had looked back to their irresistible best. He'll miss the Clasico now!
On Sunday, the Spaniard reached an unwanted milestone by becoming the first player in history to receive 20 red cards in La Liga.