Monta Ellis never doubted it for a second.

And the Milwaukee Bucks guard had less than a second remaining when he tossed up an off-balance 27-foot shot that twirled around and nearly bounced out before settling back in the net, beating the buzzer and the Houston Rockets on Wednesday night.

Ellis' walk-off winner was just that, although he actually ran off the floor and into the locker room after giving the Bucks a 110-107 victory at the Toyota Center.

"I didn't want to go into overtime," Ellis said. "I was kind of winded.

"The buzzer went off when it was rolling around the rim. There was no need for me to come back out."

The referees reviewed the shot through video replay and quickly ruled that it counted.

Ellis' dramatic shot capped a productive two days for the Bucks (28-28), who swept Dallas and Houston on their short Texas trip. Milwaukee was able to regroup after losing its previous three games by a total of six points.

The Bucks grabbed two offensive rebounds before holding the ball for the final shot, but Brandon Jennings was trapped with time running out and had to get rid of it.

Ellis went off one leg for the game-winner.

"He threw it up there," Bucks center Larry Sanders said. "He makes those shots in practice and stuff, so it's funny."

Ellis, who scored the go-ahead basket in Dallas on Tuesday, finished with 27 points, a season-high 13 assists, six steals and six rebounds while playing 45 minutes on the second night of a back-to-back set.

"He's all over the floor," Bucks coach Jim Boylan said. "He's playing defense. Offensively he's getting after it. He's doing everything for us right now.

"I don't know if anybody in the league is playing as hard as he is right now, with his intensity and focus. It's an inspiration to his teammates."

Ersan Ilyasova added 20 points and 10 rebounds and converted a three-point play after the Bucks trailed, 105-99.

Mike Dunleavy drilled a three-pointer to tie the score with 1 minute, 34 seconds left, and Sanders contributed a late block on James Harden and a tip-in to give the Bucks a two-point lead.