Heinrich Klaasen and David Miller hit unbeaten half-centuries to set up a nine-run win for South Africa in a rain-reduced opening one-day international against India on Thursday.

The left-handed Miller (75) and Klaasen (74) put on an unbeaten stand of 139 runs after the tourists lost their top four in the 40-overs-a-side match in Lucknow.

The bowlers led by Lungi Ngidi then kept India down to 240-8 despite Sanju Samson's unbeaten 86 off 63 balls as South Africa took a 1-0 lead in the three-match series.

"A good fight at the end, obviously Sanju pushed us, but the boys stood firm and took us to the win," skipper Temba Bavuma said after the win.

"Miller and Klaasen played positively, strung together a partnership and took us to a good score. The bowling was good upfront. At the end of the day, we were able to stay calm under pressure."

The Proteas keep themselves in the hunt for a direct entry into next year's 50-over World Cup with crucial Super League points of offer for the 11th ranked side.

The top eight teams (seven and hosts India) get direct qualification to the league stages of the 2023 World Cup.

Klaasen and Miller rebuilt the innings at a venue that witnessed heavy rain for two days before play started Thursday afternoon and took the attack to the opposition.

Miller, who amassed 125 runs including a century in the three-match Twenty20 series which South Africa lost 2-1, reached his 18th ODI fifty.

Klaasen followed his partner to a fifty in the same over and the two changed gears with some luck from the fielders as Mohammed Siraj dropped Klaasen on 64.

- 'Proud of the boys' -

South Africa started steadily after being put into bat first before losing their way to 71-3.

RTL

Straight bat: India's Sanju Samson in action on Thursday / © AFP

But Quinton de Kock stood firm to make 48 before departing and Miller and Klaasen then stood unconquered.

In reply, India lost regular wickets to be reduced to 51-4 including Shubman Gill bowled by Kagiso Rabada for three and skipper Shikhar Dhawan out for four off Wayne Parnell.

Shreyas Iyer and Samson put on 67 runs in their attempt to bring alive the chase as the pair got a few boundaries against the disciplined South African attack.

Iyer, who scored his third half-century in the four ODI innings, reached his 50 in 33 balls but got out four balls later to Ngidi.

Samson, who got his T20 best after surpassing his previous top of 54, stood firm with Shardul Thakur (33) and took on the bowlers in a 93-run stand and raised his second ODI fifty.

Thakur took the cue and smashed Rabada for two straight fours including a scoop over short fine-leg in a 14-run 37th over but got out in the next over to Ngidi, who returned figures of 3-52.

Left-arm wirst spinner Tabraiz Shamsi leaked 89 runs from his eight overs including 20 in the 40th over as Samson ended with nine fours and three sixes.

"Quite proud of the way the boys played the game, we didn't get a good start. The way Shreyas, Samson and Shardul batted was excellent," said Dhawan.

"We gave away too many runs on a wicket that swung and spun, the fielding wasn't great, but this was a good learning experience for us."

India have picked a second-string team after their Twenty20 side, led by Rohit Sharma, on Thursday left for the World Cup in Australia which begins later this month.