Thomas Vanek scored just before the end of the second period and Miller made 40 saves to lead Buffalo to a 3-1 win over the Canadiens on Tuesday night.
Vanek held up before driving a slap shot past goalie Carey Price from low in the left circle with 2.8 seconds remaining in the period, finishing off a passing play with Jason Pominville and Marc-Andre Gragnani.
"What a great play," Miller said. "A clean faceoff win, Pomer with a good stutter fake and puts it to Van, and Van hits his spots, and he definitely hit that one. There wasn't a lot of room there at all. You could see Carey was a little mad at himself, but I'm not sure he could have even got it unless he cheated for it. It was a great shot."
"As a team we didn't play well. We played ugly," Vanek said. "You've got to give Montreal credit. They worked hard, they beat us to a lot of battles, a lot of pucks, and I think Ryan stole those two points. That's the only way of putting it."
Raphael Diaz scored his first NHL goal for Montreal (1-3-1), which held a 41-23 shots advantage but completed an 0-2-1 homestand.
"That's a well-coached Buffalo team," Montreal center Scott Gomez said. "Millsy kept them in there. It's a great road win for them. Two mistakes and we couldn't get it by him. We gave it our all. Those are tough, but the position we're in we're going to have to fix it up pretty quick."
Price stopped 20 shots in his fifth straight start.
"We played hard," Diaz said. "We had a lot of shots, and I think we have to keep working hard."
Miller kept the game scoreless in the first period when Montreal held a 14-3 edge in shots. He also made a big glove save on Diaz's shot during a Canadiens power play midway through the third to protect Buffalo's one-goal lead.
"I think they were just so motivated," Miller said. "They came out, and every line was working really hard for them. I think we got caught watching a little bit. It took us a little while to get going but we did get going. I thought the last half of the game was a lot better."
Diaz scored his first goal in five games with the Canadiens to make it 1-0 at 2:08 of the second. The 25-year-old Swiss defenseman jumped up from the blue line to take Max Pacioretty's cross-ice pass before going wide and holding onto the puck. He beat Miller with a sharp-angle shot.
Leopold tied it 1-1 at 12:11 with his first goal.
Montreal appeared ready to head into the third period tied when defenseman Josh Gorges iced the puck at 19:54. But Buffalo's Paul Gaustad beat David Desharnais on a faceoff in the right circle, pushing the puck to Gragnani on his left. The Sabres defenseman passed back to Pominville who fed Vanek, left alone in the left circle.
Vanek wound up and then hesitated slightly before following through with a drive into the top right corner as Price came out to challenge and Gorges lunged in vain to block the shot.
"There's a few options," Pominville said. "We won the draw pretty clean. I'm in a shooting position and I just didn't think I could get it through, so when Thomas pulls out the way he did there's a lot of open ice there so he's able to put it away."
Sabres RW Patrick Kaleta broke his skate blade when he blocked Gorges' slap shot early in the third. ... Canadiens LW Mike Cammalleri missed his third straight game because of a leg laceration. He has resumed practicing with his teammates and is expected to return Thursday night in Pittsburgh.