DURHAM, N.C. -- Duke's last defensive stand put a tremendous stamp on what might be its last meeting with Maryland.

Duke forward Jabari Parker drove for a go-ahead dunk and the No. 8 Blue Devils held on to defeat visiting Maryland 69-67 on Saturday night at Cameron Indoor Stadium.

Maryland took possession with 20.9 seconds left trailing by one. Forward Charles Mitchell's potential game-winning attempt from the lane rolled off the rim with two seconds to play.

"Holding my breath," Duke forward Amile Jefferson said. "It was one of those hold-your-breath games."

Jefferson made one free throw with 1.1 remaining to account for the final score, capping a classic in the final scheduled meeting between the schools. Maryland leaves the Atlantic Coast Conference for the Big Ten in the summer.

"They played to win and we played to win," Duke coach Mike Krzyzewski said. "That's what made it a great basketball game. ... The will to win was showing so brilliantly during those exchanges.

"We beat a real gutty team, and we were a gutty team. That was vintage Cameron, and that was one for the ages."

Parker finished with 23 points and forward Rodney Hood and guard Rasheed Sulaimon both had 11 points for Duke (20-5, 9-3 ACC).

Guard Jake Layman had 18 points and guard Dez Wells scored all 17 of his points in the last 13 minutes for Maryland (14-12, 6-7), which lost for the third time in four games.

After Parker's dunk with 1:17 left made it 68-67, Wells missed a jumper and Parker grabbed the rebound. But the Blue Devils were charged with a shot-clock violation when Jefferson's attempt failed to hit the rim to set up Maryland's final possession.

"It ended the right way with Duke getting a defensive stop," Sulaimon said.

Parker blocked Mitchell's shot with five seconds to play, then Maryland had another chance. It was gut-wrenching for the Terrapins when Mitchell's last shot did not fall.

"I don't know how Charles' shot didn't go in," Maryland coach Mark Turgeon said. "Call it the Duke gods or whatever. It's rolling in, then all of a sudden it's rolling out."

Parker's winning points came when he drove from the perimeter through the lane.

"I kind of wanted to shoot it at first, but I (saw) the lane," Parker said. "I knew I really had to finish strong at the rim."

Duke won its 30th consecutive home game to match the longest active streak in the country.

The Blue Devils went 2 of 19 from the field to begin the second half. That allowed Maryland to storm back from a nine-point hole to grab a lead with less than seven minutes to play.

It set up the wild final minutes.

"I don't know if you ever deserve to win, but I think our guys deserved better than that at the end," Turgeon said. "We played tonight for Maryland. For all former coaches, all former players, all former students. We know what it means to Maryland fans."

Wells, who is Maryland's scoring leader at 15 points per game, finally got on the board by scoring five points in a row to allow the Terrapins to close within 51-45.

A few minutes later, Wells' three-point play tied the score at 52 with 8:46 remaining. Next, his basket in transition gave Maryland a lead for the first time.

Mitchell scored on Maryland's first two possessions of the second half, giving him 12 points in the game (or more than in any ACC game this season). But he was stuck with his fourth foul with 16:07 left.

Duke led 39-33 at halftime as Parker had 14 points. The Blue Devils scored seven points in a row until Maryland guard Nick Faust hit a runner at the buzzer.

The Blue Devils built a 10-point lead in the first 12 minutes as fouls mounted against Maryland, which received eight of its first 14 points from Mitchell.

Hood picked up his third foul with 7:36 left in the half.