OAKLAND, Calif. (AP) — Stephen Curry hit a go-ahead 3-pointer from the top with 31.9 seconds left on the way to 30 points, and the sloppy Golden State Warriors held off the Toronto Raptors 117-112 on Wednesday night.

Kevin Durant's 3-pointer with 1:02 remaining tied the game at 112, then he found Curry for the 3 that made the difference.

Durant finished with 29 points on 11-for-20 shooting, Klay Thompson scored 22 points with four 3-pointers, and Curry capitalized with a huge second half.

DeMar DeRozan scored 24 points. He drove through the paint for a dunk with 3:53 to play then hit a key jumper a minute later to put Toronto in position after Curry, Durant and Thompson each missed key 3s down the stretch.

Draymond Green had points, 11 rebounds, six assists and two steals but also six of Golden State's 17 turnovers.

Curry scored 13 of his points in the third quarter and the defending champions avoided falling to 0-2 at home after losing their opener to Houston on Oct. 17.

Curry made an off-balance layup with 1:28 to go then Golden State made a stop on the other end before Durant's big 3.

Pascal Siakam scored 20 points as Toronto lost its 13th in a row at Golden State and seventh straight in the series. Serge Ibaka added 15 points and Kyle Lowry 14 points and nine assists.

Thompson had two 3s and Durant another from downtown during a 9-0 run late in the second quarter and Thompson another in the waning seconds that put Golden State up 61-53 at the break.