BOSTON (AP) -- Chase Rettig completed a 14-yard touchdown pass to Johnathan Coleman with 52 seconds left to give Boston College a 20-17 victory over Maryland on Saturday.
The victory snapped a five-game losing streak for the Eagles (2-6, 1-4 Atlantic Coast Conference) and helped them avoid their worst start since 1989.
Former fourth-stringer Caleb Rowe completed a 66-yard touchdown pass to Stefon Diggs midway through the fourth quarter to give Maryland (4-4, 2-2) its first lead of the game. But on the first play after BC's go-ahead touchdown, Rowe was intercepted by Spenser Rositano.
A freshman making the start because of injuries to Maryland's top three quarterbacks, Rowe completed 23 of 42 passes for 240 yards and two touchdowns. But he was also picked off three times.
Wearing stars-and-stripes uniforms for Military Appreciation Day, Boston College opened a 13-0 lead early in the third quarter thanks to a pair of interceptions and then came back after giving up the lead.
Rettig was 21 for 39 for 287 yards and two touchdowns, completing his last six passes on the game-winning drive. Alex Amidon caught nine passes for 137 yards.
Diggs had 11 catches for 152 yards for Maryland, and Wes Brown ran 23 times for 73 yards.
The Eagles scored on a two-play, 39-yard touchdown drive on their first possession and took over on the Maryland 19 on their second thanks to Spiffy Evans' 72-yard punt return. But Andre Williams fumbled the ball into the end zone, where it was recovered by Darius Kilgo for a touchback.
BC made it 10-0 on Nate Freese's 36-yard field goal early in the second quarter and made it 13-0 on a 28-yarder early in the third.
They had a chance to ice it when Rowe sailed a third-and-7 pass over the middle into double-coverage that linebacker Nick Clancy had in his hands but dropped. On fourth down, Rowe hit Kevin Dorsey for 26 yards; on fourth-and-goal from the 1 yard-line, Rowe connected with Nigel King for the touchdown that made it 13-7.
After BC went three-and-out, losing 13 yards on two of Maryland's five sacks, Rowe led the Terps into position for Brendan Magistro's 28-yard field goal that made it 13-10.
BC twice went three-and-out before Maryland took over at its own 27 yard-line and needed just three plays to score. Rowe hit Diggs on a slant pattern, and the receiver headed to the left sideline before outsprinting the coverage to the end zone.
BC took over with 4:45 left, and Rettig missed on four of his first six attempts before clicking. He completed two straight passes, each for a first down, before a sack that set up a second-and-17 that became a third-and-9 and forced BC to call a timeout.
But Rettig hit Amidon for 17 yards to the Maryland 19, Bobby Swigert for five more yards and then found Coleman in the right flat, with no one between him and the goal line.