BLACKSBURG, Va. — The dreary, steely gray sky over Lane Stadium on Saturday matched the Terrapins football team’s outlook against Virginia Tech.

Two-touchdown favorites on Senior Day playing before an announced maroon and orange-clad crowd of 64,686, the Hokies seemed poised to extend the Terps’ recent streak of futility. Bowl eligibility would have to wait another week, the losing streak would continue and coach Randy Edsall’s late-season failures would be cemented as part of his early legacy in College Park.

But instead of dejectedly trekking off the field more than three hours later, Edsall leapt jubilantly. The Terps flooded onto Worsham Field, streaming toward the end zone where, just seconds before, quarterback C.J. Brown had dived and extended his right hand just inside the pylon.

After a week of doubts, extensive meetings between players and coaches and the search for a consistent performance to break a prolonged slide, the Terps spoiled Virginia Tech’s Senior Day with a 27-24 overtime victory, clinching bowl eligibility for the first time since 2010 and Edsall’s first win after Oct. 13 in three years as Terps coach.

“You re-evaluate,” Edsall said. “And you take a look at yourself in the mirror and say, ‘What took place? What happened? We need to get back to that place.’ And that’s what we did today.”

While the Terps defense continued its stingy performance Saturday — the defense sacked Virginia Tech quarterback Logan Thomas seven times, including three by defensive end Andre Monroe — quarterback C.J. Brown showcased his dangerous play from earlier in the year, rushing for 122 yards and two touchdowns while throwing for 135 yards, one touchdown and one interception.

Brown, who’s battled injuries since the Terps’ loss at Florida State on Oct. 5, rushed for more than 100 yards for the first time since Sept. 14 at Connecticut, and his 38-yard rush in the first quarter was his longest since a 41-yard touchdown run in the win over the Huskies. With Virginia Tech primarily playing man-to-man defense, running lanes opened for Brown underneath, and he took advantage.

“I kind of had a chip on my shoulder coming in,” Brown said. “Offense wasn’t doing very good, and that reflects [on] me, reflects the offense and so on and so forth. We felt that we had a great week of practice. We came out here. We still feel that we can play with anyone.”

Hokies coach Frank Beamer built the Virginia Tech program around strong special teams play — a brand of football known as “Beamer Ball” — but it was the Terps who benefited on that side of the ball Saturday.

First, Hokies kicker Eric Kristensen, a walk-on freshman replacing dismissed starter Cody Journell, missed a 34-yard field goal attempt in the first quarter that could have put Virginia Tech up 10-0. Then, Terps cornerback Will Likely returned a punt 63 yards for a touchdown in the second quarter to tie the game, 7-7.

On a previous punt return, Likely returned the ball 37 yards but was stopped. The next time, Hokies punter A.J. Hughes outkicked his coverage, and after a quick move, Likely was off to the races.

“I’ve been very close, and hopefully this is not going to be the last one,” Likely said. “This is just the beginning.”

For the second straight game, the Terps surrendered an early touchdown, as the Hokies drove 76 yards on six plays on their second drive before running back Trey Edmunds scampered around the left side for a 3-yard touchdown run.

But Likely’s punt return tied the game halfway through the second quarter, and the Terps scored on a quarterback sneak by Brown with 17 seconds remaining in the first half to take a 14-7 lead into halftime. Then they took the opening drive of the second half 78 yards before wide receiver Nigel King caught a 16-yard touchdown pass to push the lead to 21-7, marking the first time the team scored touchdowns on consecutive possessions since their 37-0 win over West Virginia on Sept. 21.

But Virginia Tech had a response. Wide receiver Demitri Knowles returned the ensuing kickoff 88 yards, setting up a 1-yard touchdown pass from Thomas to wide receiver D.J. Coles to cut the Terps’ lead to 21-14.

Early in the fourth quarter, the Hokies reeled off a methodical eight-play, 65-yard drive against a tiring defense to tie the game on a 5-yard touchdown pass from Thomas to wide receiver Willie Byrn. Virginia Tech kept the drive alive with a 38-yard pass from Thomas to Knowles on a third-and-24, and the game went into overtime.

Kristensen then kicked a field goal to give the Hokies a 24-21 lead, setting the stage for Brown’s heroics on his 3-yard scramble.

“The offense went out there, and to me, that was heart and guts,” Edsall said. “To get the ball in the end zone, that’s just all heart and all guts when you watch that.”

The Terps had close escapes earlier this year, including a one-point win over Virginia that hinged on a missed field goal.

But this win was different, not only because the Terps clinched a postseason berth, notched a signature win in Edsall’s tenure and upset a prestigious program on the road but also because of how things ended.

“We ended on our terms,” Brown said. “We ended with us scoring rather than wishing for them to miss. Any time you can do that, it’s really exciting. I’m glad we were part of it.”