Tabraiz Shamsi was "relieved" as his heroics helped South Africa edge to a one-run victory over Nepal at the T20 World Cup in Kingstown.

Nepal looked on the verge of a shock victory, needing two from the final ball to secure the win. However, Ghulsan Jha was run out at the non-striker's end as South Africa came through unscathed to make it four wins from four at the tournament.

Despite Ottniel Baartman bowling the final over, it was Shamsi's 4-19 that proved crucial in South Africa getting over the line, including two wickets in the 18th over to turn the game back in his team's favour.

The spinner was thankful South Africa avoided an unlikely defeat, telling reporters: "[I am] definitely relieved.

"The team is standing up to the pressure and that's great to see."

Proteas captain Aiden Markram praised the efforts of Nepal, whose narrow defeat means they are eliminated from the competition with one game to spare in Group D.

"You have to give Nepal a lot of credit," Markram said. "Throughout the game they put us under a lot of pressure, and it shows the quality they have."

While Nepal skipper Rohit Paudel was disappointed in the defeat, he also took pride in how his team fared against one of the tournament favourites.

"I'm very proud of the unit, the way we bowled and batted," Paudel stated. "We were very close but a little far."