Andy Farrell's Ireland will face Spain at the 2023 Rugby World Cup after the side ranked 15th in the world qualified for just the second time in their history.

Spain hung on to beat Portugal 33-28 in Madrid on Sunday to seal a place at next year's tournament in France as Europe 2, the first time the Spanish have reached the global showpiece since they took part in the 1999 World Cup.

Ireland's opening Pool B match will be against the Spanish on 9 September 2023 in Bordeaux, with the teams in a group alongside holders South Africa, Scotland and a team from the Asia/Pacific region.

Roared on by more than 6,000 fans at the Complutense University on a sunny morning in the Spanish capital, hooker Marco Pinto led the way for Spain with two first-half tries.

Scrum-half Aratz Gallastegui (C) clears the ball out of a scrum during the 1999 pool match against Scotland

Portugal threw everything at the Spaniards in the closing stages of the match but the hosts held firm and when their long overdue return to the World Cup was confirmed, the supporters invaded the pitch to celebrate with the players.

"It's impossible to describe the emotions going through my veins right now, my thoughts are with those who could not be here in this magical day, this one I dedicate to our brother Kawa Leauma who died wanting to play with us," Pinto told Reuters, remembering lock Leauma, who died aged 32 from head injuries sustained in a fall in the Netherlands in December.

Spain climbed to 29 points in the qualification group with six wins and three losses, behind Georgia who have secured their place in France with eight wins and one draw after defeating Romania 26-23 in Bucharest on Saturday.

Spain will play Georgia in their final match of the campaign on 20 March.

Portugal are third in standing with 25 points but Romania have 23 points and a game in hand against the Netherlands next weekend. The team finishing third will go into the final qualification tournament in November.

Additional reporting: Reuters