Former team captain Suzanne Fleming led a superb fight-back for the Philip Doyle-coached Irish in their Six Nations opener, as she bagged two second half tries on her 37th appearance.
Nevertheless, it proved not enough as Spanish centre Ines Etxeguibel Alberdi's haul of three drop goals and a penalty helped seal the home win.
The Irish, who picked up their first ever Six Nations win on the same Ciudad Universitaria ground two years ago, coughed up too much possession in the early stages and were down 13-0 at the break.
Cooke centre Fleming's brace got them back in touch at 16-12 but with UL Bohs winger Lynne Cantwell's late effort going unconverted, Kepa Ancin's charges claimed the spoils.
The Irish squad, captained by fly-half Sarah-Jane Belton, will hope for a better result when they take on Scotland - who lost their opener 22-15 in France -next Saturday, February 12 (kick-off 5.45pm).
The tie is to be held after the 'curtain raiser' men's match in Murrayfield and follows on from last year's outing at Twickenham.
WOMENS SIX NATIONS CHAMPIONSHIP:Spain 19 Ireland 17, Ciudad Universitaria, Madrid, 2.00pmScorers: Spain: Try: Agurtzane Obregozo Bereau; Con: Ines Etxeguibel Alberdi; Pen: Etxeguibel Alberdi; Drop goals: Etxeguibel Alberdi 3Ireland: Tries: Suzanne Fleming 2, Lynne Cantwell; Con: Sarah Jane Belton
SPAIN: M Vila Torrents; M Poza Fernandez, I Etxegibel Alberdi, R Ramirez Arregui, A Obregozo Bereau; AM Aigneren Frodden, I Rodriguez Bergareche (Capt); R Garcia Eiras, A Gonzalez de la Concepcion, A de la Parte Gutierrez, MR Rufino, A Porras Conde, O Garcia Miguel, A Masdeu Anguera, K Alegria Mendaza.Replacements: N Otxoa De Aspuru, M Carreras Espina, R Estanyol Marin, MT Delgado Martinez, M del Mar Perez Martinez, R Socias Olmos, C Ramos Tallada.
(15) Amanda Greensmith (Shannon)(14) Nuala Ni Chadhain (Galwegians)(13) Suzanne Fleming (Cooke)(12) Patrique Kelly (UL Bohemian)(11) Lynne Cantwell (UL Bohemian)(10) Sarah Jane Belton (UL Bohemian) (Capt)(9) Tania Rosser (Blackrock)(1) Fiona Coughlan (UL Bohemian)(2) Jean Lonergan (Shannon)(3) Edel Coen (UL Bohemian)
(16) Marie Barrett (Highfield)(17) Emma Stanley (UL Bohemian)(18) Rachel Tucker (UL Bohemian)(19) Orla Brennan (Navan)(20) Louise Beamish (UL Bohemian)(21) Joanne O'Sullivan (Lichfield)(22) Grace Davitt (Boyne)
Head Coach: Philip DoyleAsst Coach: Colin MoranManager: Mark AndrewsAsst Manager: Joy SparkesKit Manager: Michael KellyPhysiotherapist: Shirley Real
Referee: Jean-Luc Rebollal (France)
Wales Women 0 England Women 81France Women 22 Scotland Women 15