Maryland had won three straight early-season tournaments in a variety of locales – from the U.S. Virgin Islands three years ago in the Paradise Jam to Kansas City in the CBE Hall of Fame Classic two years ago to Riviera Maya, Mexico, in last season's Cancun Challenge.

The Terps can now add Brooklyn, N.Y., to the list.

Melo Trimble can now add another magic moment to his resume.

A layup by the junior guard with 6.6 seconds left and a subsequent missed desperation shot by Kansas State's Barry Brown gave Maryland a thrilling 69-68 victory Saturday night in the championship game of the Barclays Center Classic.

The victory was the fifth in six games against Division I competition that went down to the wire for Maryland (7-0), marking the fifth time this season that the Terps were forced to come from behind in the second half.

It marked the second time this season that Trimble scored the game-winning points, the first coming in a one-point win over Georgetown on Nov. 15 at Verizon Center.

Trimble, who tied a career high with 31 points in the opening round against Richmond on Friday, was named the tournament Most Valuable Player.

Trimble scored nine of Maryland's last 11 points to finish with 18 points, but did commit five of the Terps' season-low eight turnovers. Junior center Michal Cekovsky added a career-high 16. Center D.J. Johnson led Kansas State (5-1) with a career-high 26.

A drive by Trimble with 20.2 seconds left cut Maryland's deficit to one, 68-67. The Terps thought they had forced a five-second violation on the inbounds pass, but the Wildcats were able to call timeout.

Freshman guard Anthony Cowan fouled senior forward Wesley Iwandu, who missed the front end of a one-and-one. Trimble got the rebound, took the ball into the frontcourt and drove down the lane with his left hand to score as he was fouled by Johnson.

Leading by as many as nine late in the first half, Maryland maintained its lead behind the surprising offensive play of Cekovky until two straight 3-pointers by Kansas State guard Kamau Stokes (City) tied the game at 54 with 6:43 to play.

Stokes hit a 3-pointer for the Wildcats to give Kansas State a 64-61 lead. Cowan was fouled and made a pair of free throws to pull the Terps to within one. Johnson then was fouled going to the basket and made both free throws with 2:12 left.

Trimble answered with two foul shots to cut the deficit to 66-65. After a layup by Johnson extended Kansas State's lead back to three, the Wildcats didn't score again.