Ireland's hopes of automatic qualification for the Rugby World Cup 2021 took an almighty hit as they lost to Spain in Parma.

The winner of the round-robin competition earns a place in the New Zealand tournament next year but Adam Griggs’ side face an uphill task, having to beat Italy, who they play on Sunday, and Scotland and hope other results go their way.

Ireland led for most of an error-ridden game but were made to pay for not taking their chances when Spain, ranked ninth in the world, crossed for a try with nine minutes to play.

Béibhinn Parsons' converted try had give Ireland the lead on eight minutes after an early Patricia Garcia penalty had put the Iberians in front.

The team move and finish by the Galway winger was the only highpoint of a bitterly disappointing night for Irish rugby.

Dorothy Wall and Sene Naoupa bashed up the middle and out-half Stacey Flood spun the ball out early and wide.

Parsons had to stretch but gathered and sidestepped her marker before running in for a superb try.

When the Connacht player was hauled down just short of the line moments later after a similar run it looked like Ireland would dictate proceedings.

But while Ireland had the better of the lineout exchanges, Spain forced a number of penalties at scrum time and that meant that Ireland couldn't rely on a steady stream of possession.

And even when they did secure primary ball a shocking number of basic handling errors scuppered whatever half chances they had.

Spain’s attack was also hampered by mistakes but a series of well-timed jackals in defence meant they were still in the game as the clock ticked down.

Amee-Leigh Murphy Crowe thought she had got Ireland's second just after the break off a fine move that started with a clean lineout and went through a number of hands in the backline but an eagle-eyed TMO spotted the meekest of knock-ons by Kathryn Dane in the build-up.

That may have been enough but when Ireland, who finished third in the Six Nations, failed to add on another score a shock result looked on the cards.

Debutant forward Sam Monaghan was yellow-carded for her part in stopping a try-line-bound maul in the 67th minute but Ireland managed to stop the subsequent attack just under the posts, captain Ciara Griffin and Naoupa throwing their bodies on the line.

But as Ireland, ranked eight in the standings, cleared the ball towards touch, a player went ahead of the kicker and Spain captain Garcia took a quick penalty before the ball came to replacement Lea Ducher, who dived over for the winning score.

Replacement out-half Enya Breen, who took over when Flood retired after cramping up, missed a chance to steal the result when her kick dropped just short of the posts and Spain held out for a sensational shock win.

The second-placed team in the round-robin gets another chance via a final qualification tournament but with Italy beating Scotland 38-13 earlier in the day, Ireland will need to produce a much improved showing to figure.

Ireland: Eimear Considine; Amee-Leigh Murphy Crowe, Lucy Mulhall, Sene Naoupu, Beibhinn Parsons); Stacey Flood, Kathryn Dane; Lindsay Peat, Cliodhna Moloney, Linda Djougang; Aoife McDermott, Nichola Fryday; Dorothy Wall, Ciara Griffin (capt), Brittany Hogan.

Replacements: Neve Jones, Laura Feely, Leah Lyons, Sam Monaghan, Edel McMahon, Emily Lane, Enya Breen, Lauren Delany.

Spain: Nera Echebarria; Bea Dominguez, Amaia Erbina Amalia Argudo, Maria Garcia; Anne Fernandez de Corres, Patricia Garcia; Saoia Jaurena, Marga Rodriguez, Laura Delgado; Anna Puig, Monica Castelo; Olivia Fresneda, Maria Calvo, Lourdes Almeda.

Replacements: Isabel Rico, Cristina Blanco, Maika Brust, Carmen Castellucci, Carmen Rodera, Lucia Diaz, Lea Ducher, Eva Aguirre.