Two years after nearly quitting cricket while battling mental health issues, late-blooming opener Sarel Erwee savoured a brilliant maiden century on Friday to drag South Africa back into the Test series against New Zealand.

The 32-year-old left-hander's sparkling 108 on day one of the second Test at Hagley Oval helped the Proteas to a position of strength at 238 for three at Stumps after captain Dean Elgar won the toss and sent his team in to bat.

It was a stunning turnaround for both team and player, with Erwee managing only 10 runs on debut last week as South Africa crashed to its second-worst defeat in Tests in the first meeting at Christchurch.

ALSO READ : After Ashes cakewalk, Cummins prepares for slow grind in Pakistan

It was also a day that Erwee could scarcely have dreamt of while in "dark places" two years ago.

"I was probably a phone call away from calling it quits," Erwee told reporters.

"But my parents kind of picked me up and (I) saw a sports performance psychologist and we worked through it daily.

"It was a hard slog, if I can call it that, to try to get motivated again, to kind of give my best after wanting to give up."

Erwee, who bats for the Durban-based Dolphins and has racked up nearly 100 first class matches, has had to be patient.

He was called into his first Test squad at the end of 2020 for the Sri Lanka series but missed out on a debut.

He might have remained uncapped this tour if Dolphins teammate Keegan Petersen had not contracted COVID-19.

With fellow-opener Elgar demanding fight from his batters after their twin capitulations in the series-opener, Erwee answered his captain's call on Friday.

He anchored its 111-run opening partnership, South Africa's biggest on foreign soil in 10 years, and shared in an 88-run stand with Aiden Markram for the second wicket to frustrate world champion New Zealand.

ALSO READ : IPL 2022: Groups assigned to all teams, league stage format explained

The runs dried up when he hit the 90s, and he had to grind through five consecutive maiden overs before pulling Neil Wagner to the fence to bring up his hundred just before Tea.

He ripped off his helmet and punched the air in celebration, soaking up warm applause from a small, COVID-capped crowd that included his New Zealand-based sister.

Two years into the pandemic, New Zealand's borders remain shut to non-residents which has been tough on the Erwees and countless other families.

"Lovely to celebrate and get that hundred in front of a bit of family," he told reporters, choking back tears.

"She's been through a tough time here so it's kind of nice to have something for her to smile about."