BLACKSBURG, Va. -- Following his team's victory over No. 17 Virginia Tech on Saturday, East Carolina coach Ruffin McNeill sought out his quarterback Shane Carden and they shared a lengthy embrace in the south end zone of Lane Stadium.

The hug for Carden was well deserved.

Carden threw three touchdown passes and scored a rushing touchdown with 16 seconds left to lead the Pirates to a 28-21 upset of the Hokies.

The senior from Houston, Texas, completed 23 of 47 passes for 427 yards in carrying the Pirates to their first victory over a ranked team since 2009 when they beat then-No. 18 Houston 38-32 in Greenville, North Carolina.

They also beat a ranked team on the road for the first time since 1996 when they topped then-No. 12 Miami 31-6.

East Carolina (2-1) snapped a five-game losing streak to ranked opponents.

"Coming back from adversity from last week (a 33-23 loss to South Carolina), that's what that hug was about," McNeill said.

"Staying the course and believing what you believe in, that's what that hug was about. Getting it done as one heartbeat, one breath, one mind, one Pirate ... that's what that hug was about."

The Pirates nearly squandered a three-touchdown lead. Virginia Tech (2-1), coming off a road win over then-No. 8 Ohio State, tied the game at 21 on an 18-yard touchdown pass from Michael Brewer to Cam Phillips with 1:20 left.

But the Pirates, after doing little in the second half, needed just three plays to go 65 yards. Virginia Tech kicker Joey Slye kicked the ensuing kickoff out of bounds, giving the Pirates the ball at their 35.

Then, Carden threw passes of 31 and 28 yards to Cam Worthy sandwiched around an illegal substitution penalty on the Hokies. He scored on a 1-yard run to lift the Pirates to the win.

"Just believing," Carden said when asked how the Pirates rallied. "Just continuing to believe. We just made some routine plays. They were playing some good defense there in the second half and we couldn't get a lot going. But we just kept believing, believing in our coaches.

"We got some good field position to start, and then Worthy made some big-time catches on that drive. When the game is on the line, you've got to make plays."

Worthy finished with six catches for 224 yards for the Pirates.

Shredding The Hokies Shane Carden passed for 427 yards in East Carolina's win Saturday, the third-most yards the Hokies have ever allowed to one quarterback in a game. Quarterback Yds School Scott Milanovich ('93) 498 Maryland Glenn Foley ('93) 448 BC Shane Carden ('14) 427 ECU David Priestley ('99) 407 Pitt Byron Leftwich ('02) 406 Marshall -- ESPN Stats & Information

Carden threw touchdown passes on the Pirates' first two possessions and three of their first four.

ECU wasted little time in getting on the scoreboard, driving 75 yards in seven plays on the game's first possession. The Pirates converted on third-and-2 from the Virginia Tech 27 when Carden's pass was batted into the air and fell into the hands of Bryce Williams, who rumbled 22 yards to the Virginia Tech 5.

Two plays later, Carden found Williams in the back of the end zone for a 4-yard scoring play to give the Pirates a 7-0 lead with 12:17 left in the first quarter.

The Pirates struck again on their next possession. A 70-yard drive that took less than a minute ended when Carden found receiver Trevon Brown in the end zone for a 15-yard score. That gave the Pirates a 14-0 lead less than five minutes into the game.

The Pirates took a 21-0 lead toward the end of the first quarter. Carden threw his third touchdown pass of the quarter, this one to receiver Isaiah Jones for 7 yards with 2:44 remaining in the quarter, to give ECU a 21-point edge.

Virginia Tech coach Frank Beamer refused to say the Hokies were suffering a letdown after their huge win over Ohio State last weekend and that led to their slow start.

"I'm not going to make that excuse," Beamer said. "I thought we were ready to play. We understood how exactly East Carolina was going to play. It wasn't a secret. They hit a couple of big plays against our defense, and offensively, we were sluggish getting started and then the defense is right back on the field.

"It just wasn't a good start, but I thought we were ready to play. We had all the respect in the world for East Carolina. They did a great job. They're well coached, and they've done a good job of recruiting. They've got some players there."

Virginia Tech managed to cut into the ECU lead right before halftime. Mustering their best drive of the first half, the Hokies went 73 yards in eight plays and got on the board when Brewer threw a 21-yard touchdown pass to Ford, who made a one-handed grab.

Officials reviewed the play to see if the ball hit the ground, but upheld the catch, and Virginia Tech cut the lead to 21-7 with 47 seconds remaining in the half.

Brewer completed 30 of 56 passes for 298 yards, with three touchdowns and two interceptions for the Hokies. But it wasn't enough to lead the Hokies to what would have been their biggest comeback win under Beamer.

"It just goes back to believing and the commitment to the team," McNeill said. "If it goes bad and you believe in that, you don't waiver when it goes bad. You don't think it's all about you when it goes well.

"There are three sides to this game, and you want all three sides working together at one. That's where the commitment to our team and putting our team first showed. We stayed focused and never got down on ourselves."