WINSTON-SALEM, N.C. -- No. 18 Wake Forest scored three goals in the second half to erase a 2-1 halftime deficit and hand No. 1 Maryland its first loss of the season 4-2 on Thursday at Spry Stadium to wrap up the 2012 regular season.

The Demon Deacons end the ACC season with a 4-1-3 record, making them the third seed for the upcoming ACC Championship. The win also pushed Wake Forest's overall record to 11-3-4 on the year, including an 8-1-1 record at home. The Terrapins are now 14-1-1 overall and 6-1-1 in the ACC.

The win was the first for Wake Forest against a top-ranked opponent since the Demon Deacons toppled Washington 2-1 on Sept. 27, 1998.

Ross Tomaselli tied the game in the 59th minute, Luca Gimenez put Wake Forest up in the 68th minute and Danny Wenzel added an insurance goal in the 77th minute to lead the Demon Deacons to victory.

Sean Okoli also scored for the Deacs, putting his team up 1-0 in the 14th minute. Okoli leads the team with 10 goals on the year.

Wake Forest went on top early when Martin played a ball in front of the keeper from the left side of the goal, and Okoli headed the ball on frame. The shot initially hit off the chest of Maryland goalkeeper Keith Cardona but found its way into the goal.

Maryland responded with two goals before the break to take a 2-1 lead into the half. John Stertzer tied the game in the 25th minute with a bicycle kick from just outside the six and Christiano Francois scored into an empty net in the 41st minute after Jordan Cyrus found him from beyond midfield.

The Deacs nearly tied the game in the 48th minute when Tomaselli and Michael Gamble each fired a shot within eight seconds of each other. Maryland defender London Woodberry was there to play both shots off the line.

Shots 11 13
Corner Kicks 2 4
Saves 3 2

Tomaselli finally tied the game about 10 minutes later. Okoli had the ball near the endline on the right side of the goal and played a ball that was heading for Jared Watts. Watts let the ball play through to a wide open Tomaselli, who blasted the shot past Cardona.

In the 64th minute, Maryland suffered a blow and was forced to play a man down when Woodberry drew a red card for a foul against Watts.

The Deacs capitalized on their man advantage just three minutes later when Duvall chipped a ball to Gimenez at the left side of the box and Gimenez buried his first touch to give Wake Forest the lead for good.

Wenzel scored his first goal of the season in the 77th minute on a penalty kick after Luciano Delbono drew a foul just inside the box.

Andrew Harris earned the win in goal by making a pair of saves for the Demon Deacons.

Wake Forest, as the No. 3 seed, will host the sixth-seeded Virginia on Tuesday in the ACC quarterfinals.