Head coach Wayne Pivac says Wales’ gutsy performance against South Africa last weekend was a step in the right direction as they build towards the 2023 Rugby World Cup.

Wales pushed the world champions to the limit, but were ultimately undone by the power of South Africa’s bench, and eventually slipped to a 23-18 defeat at the Principality Stadium.

World champions South Africa had to battle back to claim the victory in what was a compelling contest.

Wales led for 73 minutes thanks to six Dan Biggar penalties setting up an 18-15 advantage, but the defining moment was a crucial try from replacement hooker Malcolm Marx, typifying the big impact of the South African forwards from the bench.

Four penalties from Handre Pollard and kicks from Frans Steyn and Elton Jantjies sealed the Springboks’ win.

There was a controversial second-half incident when Wales replacement Liam Williams was denied a try-scoring chance by a pitch invader with the scores at 15-15, but South Africa finished strongly to notch to a first win in Cardiff in eight years.

Wales were missing many top internationals, but showed plenty of resolve after their 54-16 defeat against New Zealand, and Pivac says they have learnt a lot from the experience.

“The guys put in a shift,” he said. “If you look at the performance last week and coming up against South Africa in these conditions was always going to be a big ask and I thought the boys came up well in the game.

“We could have won that match, it came down to a couple of moments. We gave away a silly penalty before half-time and another to set up their try.

"Outside of that, we’ve a bit of work to do at the scrum, but we matched them across the park and led for periods. We could have won it at the end.

“It was a big step in the right direction, playing the world champions at their own game. I thought it was a big pat on the back for their effort.”

Wales also had a number of younger players with less than 20 caps on the field, while Ulster hooker Bradley Roberts and Scarlets prop WillGriff John made their debuts off the bench.

And Pivac insisted the likes of Rhys Carre, Ben Carter, and Taine Basham will be better for the experience.

“I think playing South Africa in those conditions, which is ideal for how they want to play the game, was going to be a testing time,” he said.

“I thought we stood up to that test well. There were a couple of penalties that we gave away but if we can tidy that up, we’ll be competitive against the world champions in their own conditions.

"It was a big tick in the box as far as the coaching group was concerned but there’s always things we need to take away and work on.”

Pivac was also mightily impressed with the performance of Ellis Jenkins who put in a tremendous performance on his first Wales test since suffering a serious knee injury against the Springboks three years ago.

“I’m very, very pleased for Ellis, it was a big moment for him,” he said. “He didn’t do a lot of training the week before, certainly no contact, but, I was really pleased with him.”