PHOENIX (AP) -- Dorell Wright had no doubt of the outcome when Monta Ellis rose to take Golden State's final shot.
Ellis hit an 20-foot fadeaway jumper with 1 second remaining and the Warriors beat the Phoenix Suns 106-104 on Wednesday night.
"I knew it was going in," Wright said. "That's what he's about. He's a gamer."
Ellis shared Wright's confidence.
"It looked good and felt good," Ellis said. "It was a tough shot but I was locked in and focused on it and it went down for me. Coach just told me to go with 5 seconds and get a good shot and I thought I did that."
Channing Frye's 3-point attempt rolled off the back of the rim at the buzzer, giving the Warriors their first win in Phoenix since March 18, 2005.
Ellis finished with a game-high 26 points, Wright had 23 and David Lee added 22 for the Warriors, who squandered a 21-point lead before rallying in the final 2:16.
"I feel like we executed on both sides of the basketball when it matters most," said Warriors coach Mark Jackson. "If I had to design a win, I would have designed it this way. It was much better for our future to grind out a win."
Golden State played all but 1 minute of the final three quarters and the entire second half without Stephen Curry, who strained a tendon in his right foot with 2:19 to play in the first quarter.
Frye had 22 points, Marcin Gortat scored 21 and Jared Dudley finished with 17 for the Suns, whose two-game winning streak was snapped.
"The way we approached the game sucked," said Suns coach Alvin Gentry. "We end up defending the hell out of the guy and he makes the shot. But that's not the difference in the game. The difference in the game was the first 10 minutes of the game.
"I'm disgusted with the way we played and I'm disgusted with the fact that we got a chance to enter the break on something upbeat and positive and instead we just walk through the first 10 minutes of the game."
Phoenix, behind for only 97 seconds in its previous two games, trailed the Warriors until the final 3:50 when Dudley scored on a layup off a lobbed inbounds pass to give the Suns a 96-94 lead.
Dudley also gave Phoenix its final lead, 100-99, when he scored off an offensive rebound with 2:26 to go.
The Warriors scored five straight to go back ahead 104-100, the last on Nate Robinson's basket with 1:23 to go, only to see the Suns tie the game again on a dunk by Frye with 1:03 left and Grant Hill's layup with 11.6 to go.
"We were panicking," Lee said. "We just didn't show it. We really didn't want to lose this one especially because we've lost 13 in a row here. We held down the fort, got a few stops and some good shots on offense."
Golden State scored the game's first seven points and ran out to a 39-22 lead after one. The Warriors stretched the lead to as many as 21 points, 59-38, before settling for a 59-45 halftime lead.
"We can't have those dry spells and defensively we were bad," Dudley said. "I can't quite put my finger on why we played bad in the first quarter. It wasn't just one thing. Even with that, we got back in the game and battled out way back."