BALTIMORE (AP) -- Operating with little sleep and much emotion, Torrey Smith played a magnificent game under the most difficult circumstances.
His teammates on the Baltimore Ravens helped Smith cope, then provided him a victory for his effort.
Rookie Justin Tucker kicked a 27-yard field goal as time expired, giving the Ravens a 31-30 victory over the New England Patriots on Sunday night in a rematch of the AFC championship game.
Playing less than 24 hours after his younger brother died in a motorcycle accident, Smith scored two touchdowns and caught six passes for 127 yards. Only hours earlier, he wasn't even sure if he would suit up.
"It was tough. I didn't know until 4 o'clock if I was going to play," Smith said. "I only had like an hour of sleep. Emotionally, I didn't know how I was going to hold up."
Smith left the team hotel at 1 a.m. Sunday to be with his family. Upon arriving at the stadium, the familiar surroundings helped Smith get ready to go.
"When I came here, the more I was grounded. The more comfortable I began to feel," he said. "I'm glad I came back up here. It helped me out a lot."
Coach John Harbaugh said: "If you're around athletics, I guess you feel like it's an escape, an opportunity to do what he does. He's being doing it his whole life; he knows what to do. When Torrey said he wanted to play, the decision was finished. He was going to get the opportunity to play, he deserved that."
A moment of silence was observed before the game for Smith's brother, 19-year-old Tevin Jones.
"It means a lot not just for us but for my family. ... That's for my little brother,'" Smith said.
When the teams met in January, the Patriots squeezed out a three-point win at home to advance to the Super Bowl. The stakes weren't nearly as high in this one, yet the game was eerily similar.
In the previous meeting, Billy Cundiff missed a 32-yard field goal in the closing seconds. In the encore, Tucker - who took the job away from Cundiff in training camp - drove his kick just inside the right upright.
The game-winning kick followed a pass interference call against Devin McCourty, who was covering Jacoby Jones.
As the officials were leaving the field, Patriots coach Bill Belichick grabbed one of them by the arm. He didn't pursue as the official continued to run off the field.
"I'm not going to comment on that," Belichick said. "You saw the game. What did we have, 30 penalties called in that game?"
Actually, 24, including 14 against the Ravens for 135 yards.
Baltimore (2-1) won its 12th straight at home behind Joe Flacco, who went 28 for 39 for 382 yards and three touchdowns.
Tom Brady completed 28 of 41 passes for 335 yards and a score for the Patriots (1-2), who fell below .500 for the first time since Week 1 of 2003.
"We didn't do what we needed to do to help our offense tonight," Patriots defensive tackle Vince Wolfork said. "And it (stinks), because coming into the game, I think we had a pretty good idea of how we wanted to play it. First quarter, it showed. It seems after that, we really couldn't get off the field. Offense played their tails off and we just left them out to dry. We can't do that."
New England led 13-0 after the first quarter and 30-21 with 14 minutes left, but couldn't make either lead stand up.
Wes Welker had eight catches for 142 yards and Brandon Lloyd caught nine passes for 108 yards for the Patriots, who fell to 6-1 against the Ravens in the regular season - 7-2 including the playoffs.
Down 20-14, the Ravens opened the second half with an 80-yard drive that ended with a 7-yard touchdown run by Ray Rice. Brady matched that with an 80-yard march of his own, repeatedly picking on cornerback Cary Williams, before Danny Woodhead scored on a 3-yard run to put New England ahead.
After Stephen Gostkowski kicked his third field goal to make it 30-21, Smith caught a 5-yard touchdown pass with 4:01 left to get the Ravens to 30-28. Flacco went 6 for 7 for 76 yards in the 92-yard drive.
Baltimore executed the game-winning drive in the final 2 minutes.
New England took a 13-0 lead before the Ravens got their initial first down. Then, after Baltimore went up 14-13, Brady engineered a frantic touchdown drive at the end of the first half to put the Patriots back in front.
Welker, who came in with only eight catches in two games, played a key role for New England in the opening minutes. He recovered a fumble by Brady on the Patriots' second play, and on New England's second series Welker broke loose on the left sideline for a 59-yard completion that set up a 37-yard field goal.
The long pass to Welker pushed Brady into 12th place on the career yardage list, past Hall of Fame quarterback Joe Montana (40,551).
On the first play following the kickoff, Steve Gregory intercepted a pass by Flacco and took it 36 yards to the Baltimore 6. On third down, rookie Brandon Bolden ran in from the 2 for his first NFL touchdown.
Late in the first quarter, Gostkowski kicked a 49-yard field goal for a 13-0 lead.
After two three-and-outs and an interception, Flacco found his rhythm the fourth time he got the ball.
Flacco moved the Ravens 82 yards in 13 plays in a drive culminated by a 25-yard touchdown pass to Smith. Then, after a New England punt, Baltimore covered 92 yards in eight plays. The capper was a 20-yard TD pass to tight end Dennis Pitta, who hurdled Gregory inside the 10 before completing his romp into the end zone.
Brady answered with a touchdown pass of his own, a 7-yarder to Julian Edelman with 2 seconds left to cap an 81-yard, beat-the-clock march.
NOTES: Baltimore amassed 503 yards in offense. Rice ran for 101 yards on 20 carries. ... Edelman left with a hand injury. ... Baltimore punted only three times.