DENVER - A change on the bench gave the Denver Nuggets a boost and ended six weeks of frustration for the struggling franchise.

Danilo Gallinari scored a season-high 26 points, Kenneth Faried had 14 points and 14 rebounds and Denver beat the Milwaukee Bucks 106-95 on Tuesday night, hours after Brian Shaw was fired as coach.

Guard Ty Lawson had 16 points and 10 assists for Denver, which ended a six-game losing streak and won at home for the first time since Jan. 14.

"We've had a humongous monkey on our back, trying to get it off and we finally got it off," interim coach Melvin Hunt said. "The home fans have been enduring a lot of stuff. We wanted to win for them."

Shaw was fired after 1 1/2 seasons with the team at 20-39. Hunt, an assistant on Shaw's staff, will lead the team for the rest of the season, general manager Tim Connolly said before the game.

Khris Middleton led Milwaukee with 20 points. Giannis Antetokounmpo had 19 points and 11 rebounds for the Bucks, who have lost five of six.

"For a young team this is a good learning experience going into March where everything is heightened," Bucks coach Jason Kidd said.

Denver led by six after three quarters and started the fourth on an 11-2 run to go up 87-72. The Bucks scored six straight points, but rookie Erick Green hit a 3-pointer and was fouled. He sank the free throw to make it 91-78 with 6:08 left.

Milwaukee got within 95-89 on a 3-pointer by Antetokounmpo but Gallinari responded with his fourth 3 at the other end.

"That's what we are supposed to do," Gallinari said. "We are basketball players and we get paid a lot of money to do this."

Lawson, who had just five points in Sunday's loss to New Orleans, had 12 points in the second half and seven in the final 5:37 to help Denver get its first home win since beating Dallas.

"Six weeks. That's over," Lawson said. "I'm glad it's over and glad the fans get to see us get a win before we go on the road."

Shaw went 56-85 for a .397 winning percentage. The Nuggets lost their last 10 games at home under Shaw, one shy of tying the franchise record set in 1997-98. The team has nosedived since the All-Star break, and attendance has suffered.

The timing of the dismissal was somewhat surprising given that just last week Connelly seemed to signal Shaw's job was safe at least through the end of the season. It also happened hours before tip-off.

"We were hopeful we could dig ourselves out of the hole, play more respectful basketball," Connelly explained. "Unfortunately, our struggles have been pretty immense and led to today."

The Nuggets responded to the firing with their most inspired half of basketball in a few weeks. They raced out to an early 11-point lead, saw Milwaukee rally to go ahead by seven but recovered to take a 55-51 lead at halftime.

TIP-INS

Bucks: G O.J. Mayo did not play due to right hamstring soreness. He has missed three of the last four games. ... Jared Dudley was hit with a flagrant 1 foul in the third quarter. ... The Bucks have lost five straight in Denver. They last swept the season series from the Nuggets in 2009-10.

Nuggets: F Darrell Arthur returned to action after missing two games with a right calf strain. ... Cr Jusuf Nurkic missed his third straight game with a sprained ankle. Nurkic's ankle is discolored and badly swollen a week after suffering the injury. ... Rookie Joffrey Lauvergne didn't play after getting into the last five games, including one start.

UP NEXT

Raptors: At Golden State on Wednesday.

Nuggets: At Minnesota on Wednesday.