BALTIMORE – Torrey Smith turned in an emotional — and sensational — performance under very difficult circumstances.

His teammates on the Baltimore Ravens helped make it a winning 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.

Smith started and scored two touchdowns for the Ravens, less than 24 hours after his younger brother was killed in a motorcycle accident late Saturday night. Smith left the team shortly after midnight Saturday but returned in time for warmups Sunday. The second-year wide receiver finished with six catches for 127 yards.

“It was tough, emotionally,” Smith said. “I didn’t know how I would hold up.

“It means a lot not just for us but for my family. … That’s for my little brother.”

A moment of silence was observed before the game for Smith’s brother, 19-year-old Tevin Jones.

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 over the right upright, and it was ruled good over the protests of the Patriots.

The kick followed a pass interference call against Devin McCourty on 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.

Baltimore (2-1) won its 12th straight at home behind Joe Flacco, who was 28 of 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.

Replacement officials marked off 24 penalties, including 14 against Baltimore. Both Ravens Coach John Harbaugh and Belichick spent much of the night yelling at the officiating crew.

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.

Baltimore overcame a 13-0 first-quarter deficit to take a 14-13 lead in the second quarter, then rallied again in the fourth quarter after the Patriots opened a 30-21 advantage. Smith’s 5-yard touchdown catch with 4:01 left cut the deficit to 30-28.