Middleton scored 14 points in the final quarter, giving the Wizards trouble off the dribble and from the perimeter.
Washington got within three when John Wall made two free throws with 1:36 left. But Middleton answered again, hitting a jumper in the lane on the next possession before setting up a drive-and-dish to Greg Monroe that gave the Bucks a 97-90 lead with 15 seconds left. Middleton tied a season high with nine assists.
Bradley Beal scored 19 points for the Wizards, and Wall had 15 points and 10 assists.
The Wizards go into the All-Star break 3-7 in their last 10 games.
The Bucks will take a modest but badly-needed two-game winning streak into the break. At 22-32, Milwaukee needs to inch back closer to .500 before it can start thinking about making a run at a second straight playoff appearance.
At least the Bucks gained confidence from the win after the lead see-sawed much of the night against Washington.
Sparked by better defense, the Wizards rallied from an 11-point deficit late in the second quarter to turn it into a tight contest after halftime.
Milwaukee used a 25-5 surge in an eight-minute span to help build a 55-44 lead with 45 seconds left in the second quarter. Jabari Parker scored 12 points during that quarter, when the Bucks made their run using primarily a three-guard lineup that attacked with the ball.
Middleton made the clutch plays in the end to spark the win.
Washington: Wall had his 30th double-double of the season. … The Wizards went 0 of 10 from the field with three turnovers during the Bucks’ second-quarter run.
Milwaukee: Bucks co-owner Marc Lasry is taking part in the All-Star celebrity game Friday in Toronto. Asked before the game if the boss was ready, coach Jason Kidd said with a straight face: “That’s a very good question. We’ll see if he needs the asthma inhaler.” … O.J. Mayo was assessed a flagrant foul after Washington’s Otto Porter Jr. fell hard to the floor on a layup attempt with 10 minutes left in the third quarter.