Royal Challengers Bangalore ended a three-match losing streak in the Indian Premier League as Josh Hazlewood and Harshal Patel inspired them to a 13-run win over Chennai Super Kings on Wednesday.

Bangalore scored 173-8 after Mahendra Singh Dhoni’s Chennai won the toss and chose to field first.

CSK slipped away after a strong start and ended their chase on 160-8.

“We definitely needed that, just for the confidence in the group,” RCB captain Faf du Plessis said.

“The guys have been doing some good things behind the scenes but you have to do it out in the middle.”

Australian seamer Hazlewood bowled four tight overs, dismissing Dhoni for two and giving away only 19 runs.

India’s new T20 specialist Patel took three key wickets — Moeen Ali (34), Ravindra Jadeja (3) and Dwaine Pretorius (13) — for 35 runs in his four-over spell.

CSK openers Ruturaj Gaikwad and Devon Conway hit 51 in the power-play but their middle-order faltered.

Both Gaikwad, who hit three fours and a six, and Conway, with six fours and two sixes, looked fluent before falling to the Bangalore spinners.

Gaikwad holed out off Shahbaz Ahmed after scoring 28 off 23 balls.

Sri Lankan Wanindu Hasaranga dismissed Conway for a 37-ball 56.

In-form pair Robin Uthappa (1) and Ambati Rayudu (10) both succumbed to Glenn Maxwell’s off-spin.

Batting all-rounder Maxwell finished with 2-22 from his four overs.

Earlier, Bangalore started well with Du Plessis and Indian superstar Virat Kohli adding 57 runs in the first six overs of the match.

South African Du Plessis fell for 38 off 22 deliveries to Moeen.

The England all-rounder also bowled Kohli as his difficult IPL continued with a scratchy 30 off 33 balls.

Kohli scored his first half-century of the season in his team’s defeat to Gujarat Titans last time out.

Australian Maxwell was run out just three balls into his innings when Kohli called for a risky single.

Rookies Mahipal Lomror, with 42 off 27 balls, and Rajat Patidar helped RCB post a challenging total.

India veteran Dinesh Karthik, who is still hopeful of an international comeback, once again impressed with a timely 26 not out, including two sixes in the final over.

Sri Lankan Maheesh Theekshana took 3-27 for Chennai.

Dhoni, who gave up the captaincy ahead of this year’s IPL and surprisingly accepted the job back last week from Jadeja, blamed his batters for the loss.

“What really let us down was the batsmanship,” he said. “If the batsmanship had been slightly better, maybe in the last few overs we wouldn’t have needed many runs.”