BOSTON — The Washington Wizards have changed since their last trip to Boston, when they blew a double-digit lead and lost to the Celtics.

This time they won it just fine.

Andray Blatche scored 31 points and added 11 rebounds Friday night for Washington, which opened a 28-point first-half lead and held on through a late flurry of 3-pointers from Nate Robinson to beat Boston 106-96.

It was one month after the Wizards blew a 13-point lead with six minutes left to drop their third straight game in a losing streak that grew to 16.

“During that stretch we lost a lot of games when I thought we were playing pretty good. I think we learned some things and have grown from that,” said Wizards Coach Flip Saunders, whose team long ago fell out of playoff contention.

“Our guys have kept on playing. When you look at what we’ve done from the standpoint of blowing the team up, basically playing with a new team, our guys could have said, ‘Hey, just play it out.’ But they’re not. They’re playing with fire. They’re hungry to learn.”

Shaun Livingston scored 25 points, and backup JaVale McGee had 14 points and 11 rebounds for the Wizards, who have won 4 of 6 since snapping their 16-game skid.

Livingston hit all six of his free-throw attempts down the stretch, and Blatche made 3 of 4 in the last 10 seconds to turn Boston back after Robinson hit three straight 3-pointers in a span of 17 seconds.

“I started getting a little nervous,” Blatche said. “But (Livingston) calmed everybody down and took control of the game.

“That’s the kind of leadership we’ve got on this team, and that’s exactly what he did.”

Rajon Rondo had 17 points and 12 assists for playoff-bound Boston, which lost for the fifth time in seven games and again was booed by the home crowd.

The Celtics have lost 4 of 5 at home; the only win in Boston in the last two weeks was Sunday’s victory against the Cleveland Cavaliers.

“We’re at home. We look for our fans to give us energy, to give us a spark when times are tough,” forward Kevin Garnett said. “It doesn’t help when the boos happen, but we’re a veteran team. When that occurs we all just get together and say, ‘We just have to grind this out.’ “

In their last meeting March 7, the Celtics erased a 13-point Washington lead with 6:11 left, scoring 20 of the last 24 points to win 86-83.

This time Boston was behind by 21 at the end of three and still trailed by 14 with 1:08 left when Robinson hit the first of three straight 3-pointers that made it 97-91 with 51 seconds to play.

He added a layup that made it 99-93 with 42 seconds left. But he missed the next three 3-point tries, a couple of them off-balance and rushed, and the Celtics never got any closer.

“I think Nate can just wake up and make shots. That’s who he is,” Celtics Coach Doc Rivers said.

“Nate is not in our rotation right now, but he’ll win a playoff game for us. There’ll be a game where we’re flat and we’re going to need someone to come in and make something happen, and Nate will do that.”

The Celtics, who were 23-5 after beating Orlando on Christmas Day, are 26-25 since then. They dropped a game behind Atlanta in the race for the third spot in the Eastern Conference playoff race; the No. 4 team, if it wins its first-round series, likely would have to play LeBron James and the Cavaliers in the second round.

The Wizards scored the first eight points of the second quarter and extended the lead to 47-19 with five minutes left in the half.