The loss ended a 14-game winning streak by Maryland (16-2, 4-1 Atlantic Coast Conference).
Kelsey Wolfe led the Cavaliers (10-9, 3-3) with 24 points. Ataira Franklin and Faith Randolph each had 19.
Virginia halted a five-game losing streak against Maryland and won its second straight against a ranked opponent. The Cavaliers beat No. 24 Florida State on Sunday.
The Terps fell behind 45-38 when Virginia opened the second half on an 11-0 run and never got closer than four in the final 14 minutes.
Both teams shot 50 percent from the field, but Virginia had eight 3s while the Terps had four.
Lexi Gerson and Sarah Imovbioh each added 12 points for the Cavaliers.
After the game, Virginia coach Joanne Boyle got on the public address microphone and thanked the crowd. It was Virginia's first victory against a top-10 team since they beat No. 3 Tennessee in 2011.
Thomas, whose fourth basket of the first half put her over the 2,000 mark for her career, had foul trouble in the second half but played extensively with four fouls, trying to rescue her team.
Five quick points by Alicia DeVaughn after Virginia's 11-point run in the second half pulled the Terps to within 47-45, but Wolfe made a 3-pointer and Gerson followed a Maryland turnover with a foul-line jumper, pushing the lead back to 52-45.
The Cougars fell to 10-8, 1-2 and had their winning streak halted at three.
After the lead went back and forth early in the game, Towson settled down midway through the second half and took control.
Cairn 38, Notre Dame Maryland 30: Naimani Staley scored a game-high 15 points, but the visiting Gators (1-16, 1-8 Colonial States Athletic Conference) couldn't overcome a lackluster first half.
Notre Dame shot below 10 percent in the first half and was outscored 17-7. The Highlanders improved to 1-12 and 1-8
Mount St. Mary's 83, Saint Francis (Pa.) 77: Sam Prescott scored a season-high 25 points, including a timely 3-pointer in the final minute to lead the visiting Mount (7-11, 3-2 Northeast Conference) past the Red Flash (3-15, 1-4).
Gregory Graves added a career-high 17 points off the bench for the Mount.
After seeing a 14-point second-half lead whittled to 74-71 with just over a minute remaining, Prescott made a 3-pointer as the shot clock expired to give the Mountaineers a 77-71 lead with 43 seconds left. From there, the Mount sealed the win at the free-throw line.
Prescott finished 7-for-15 from the field, 3-for-4 from 3-point range and 8-for-8 at the foul line. Graves chipped in 17 points and seven rebounds while Taylor Danaher (11 points) and Byron Ashe (10 points) also reached double figures.
Rashad Whack had nine points, eight rebounds and four assists for the Mount. Julian Norfleet, who entered the game leading the Northeast Conference in scoring at 20.1 points per game, was held to four points.
Earl Brown paced all scorers with 30 points while adding eight rebounds for the Red Flash (3-15, 1-4). Greg Brown chipped in 10 points, five boards and three steals in the loss.
Leading 49-46 with just under 12 minutes left in the second half, the Mount went on a 16-5 run to take a 65-51 lead with 7:48 remaining. Whack started the run with a 3-pointer, while Graves added back-to-back baskets, including a dunk after a steal, to push the lead to 61-51. Prescott added a nice drive and Ashe scored on the fast break to cap the spurt and give the Mount its biggest lead of the contest.
No. 2 Notre Dame women @No. 6 Maryland
Monday, 7 p.m.