Japan overturned a nine-point deficit at halftime to beat Spain 29-21 in the teams' final match of the Women's Rugby World Cup on Sunday.

Both sides were bidding for their first win of the tournament after defeats against world champion New Zealand and Ireland had ended their hopes of reaching the quarterfinals out of Pool C before they kicked off in York, England.

Japan opened the scoring through Sora Nishimura's sixth-minute try, but Spain hit back through tries from Cristina Blanco Herrera and Monica Castelo to take a 14-5 lead at the break.

But a rejuvenated Japan scored three tries in 16 minutes in the second half before Spain lost Anne Fernandez de Corres to a yellow card.

Japan scored again through Jennifer Nduka before Spain had the final say with Victoria Rosell Martinez's try after Claudia Pena's impressive burst and offload.

Japan coach Lesley McKenzie was proud of how her side regrouped at halftime.

"(I told them) to collect all the positives, which were numerous in the first half, and keep some patience, and we will get the rewards in the second half," she said.

"We were in control in terms of territory and possession but a little impatient, which is one of our vices ... have some faith in the process, and we got there."

Spain coach Juan Gonzalez congratulated the Japanese.

"It was a very hard game and in the second half, we didn't do well," he said.

"Congratulations to the Japanese team, they did really well."