This time, the late game heartbreak belonged to the New England Patriots and wide left turned into just right.

Rookie kicker Justin Tucker barely kept a 27-yard field goal inside the right upright as time expired to give the Ravens a frantic 31-30 comeback victory Sunday night in front of an announced 71,269 at M&T Bank Stadium.

“What would be a better story than the one you saw?,” Ravens coach John Harbaugh said.

Trailing by nine points with seven minutes, 29 seconds to play, Joe Flacco threw a 5-yard touchdown pass to Torrey Smith with 4:01 left, and the Ravens’ fifth-year quarterback then led another drive in the final two minutes to set up Tucker for the game winner.

Just eight months after Billy Cundiff missed a 32-yard field goal at Gillette Stadium that would have likely sent the AFC championship game against the Patriots into overtime, Tucker converted, giving the Ravens the victory. Twice they erased double-digit victories in the game.

The win left Smith, who learned earlier in the day that his younger brother, Tevin Jones, had died in a motorcycle crash, leaping up and down on the sideline and then clutching the game ball as he exited the field. Ravens coach John Harbaugh, meanwhile, stood on the bench exhorting the fans.

“Our team just fights. We just have a bunch of guys that will not quit,” Harbaugh said. “I couldn’t be more proud of the football team.”

Patriots coach Bill Belichick ran onto the field and tried to grab the arm of an official after a game that featured several controversial calls and 24 total penalties for 218 total yards, 10 of them called on New England. Several Patriots also protested that Tucker’s field goal was called good, but the play was not reviewed.

“I’m not going to comment on that,” said Belichick when asked about the officiating. “You saw the game. What did we have, 30 penalties called in that game?”

All that mattered to the Ravens (2-1) was that they extended their NFL-best home winning streak to 11 games and they beat the Patriots for the first time in a regular season game in seven tries. They will play host to the Cleveland Browns in four days on Thursday night.

“It just means were 2-1 and not 1-2, and we can move onto Cleveland a little bit quicker than if it would have went the other way,” Flacco said.

Flacco, who was on point for much of the night, got the ball back at his own 20 with 1:55 left after a rare stop by the Ravens’ defense against Tom Brady’s offense. A 24-yard pass to Jacoby Jones, a 17-yard completion to tight end Dennis Pitta, and a pass interference call on Devin McCourty on Jones got the ball down to the Patriots’ 7. Flacco knelt down and put the game on Tucker’s foot with two seconds to go.

“It kind of goes back to something I’ve been saying, something I’ve been trying to stick to: I try to treat every kick the same way,” said Tucker who is now 7-of-7 on field-goal attempts for the season. “In that regard, I’m happy with the end result. It was good and the Ravens win so just mission accomplished.”

Flacco was 28 of 39 yards for 382 yards, three touchdowns and an interception in one of the finest performances of his career. He spread the ball around as five Ravens had three catches or more, but he had the most success throwing to Smith.

The second-year receiver caught six balls for 127 yards and two touchdowns, ending an emotional day for him and his family. Smith, who left the team early Sunday morning after learning of his brother’s accident, didn’t decide that he was going to play until a couple of hours before kickoff.

“Emotionally, I didn’t know how I would hold up,” said Smith, who celebrated his first touchdown, a 25-yard catch in the second quarter, by getting down on one knee and then pointing to the sky. “I was telling my teammates a minute ago that this was new territory for me personally. I never had to deal with a death in my family. Obviously, you play with a heavy heart and you want to play for that person.”

Tom Brady finished 28 of 41 for 335 yards, one touchdown and no interceptions, Wes Welker caught eight passes for 142 yards and Brandon Lloyd had nine catches for 108 yards. Frequently picking on the Ravens’ pass defense and specifically targeting cornerback Cary Williams, Brady led three straight scoring drives. His 7-yard touchdown pass to Julian Edelman just seconds before halftime allowed the Patriots to head into intermission with a 20-14 lead.

He then answered a 7-yard touchdown run from Ray Rice, who finished with 101 yards rushing and five catches for 49 yards, with a 12-play 80-yard drive that ended on Danny Woodhead’s 3-yard touchdown run.

A 20-yard field goal by Stephen Gostkowski on the Patriots’ next possession extended the visitor’s lead to 30-21. But the final two Patriot drives ended with punts, opening the door for the Ravens’ comeback, which started with the Smith touchdown catch at the 4:08 mark of the fourth quarter. The drive went eight plays for 92 yards and included two big penalties on the Patriots.

“There’s not a better person on this team than Torrey Smith, and to come out tonight and play the way he did with all that adversity and turmoil in his life right now, the guy is unbelievable,” Pitta said. “Enough can’t be said about him.”

After the first quarter, the Ravens were out-gained 143-21. They ran only nine plays to the Patriots’ 24, and they had zero first downs to New England’s six. They were probably lucky that they were down only 13-0. At that point, late in the first quarter, the Ravens still didn’t have a first down.

They finally got one on their next drive, thanks to a defensive pass interference call. Fortunately for them, that spearheaded a long drive that included a clutch 14-yard completion from Flacco to veteran wide receiver Anquan Boldin on 3rd-and-13. Rice then rattled off runs of eight and five years before Flacco hit Smith with a 25-yard touchdown pass in the left corner of the end zone.

Trailing 13-7, the Ravens’ offense got the ball back and Flacco led another extended drive. A 41-yard completion to Jones put the ball in New England territory. Two Rice runs advanced it to the 20 where Flacco hit Pitta on the right side. The tight end broke an arm tackle by McCourty and hurtled a lunging Gregory to score from 20 yards out and give the Ravens a 13-13 lead.

However, it was short lived. Brady got the ball back at his own 19 and with 1:41 on the clock. He hit Rob Gronkowski for 12 yards and then found Deion Branch for 11 to get the ball in Ravens’ territory. A 28-yard completion to Welker got the ball down to the seven. On 2nd-and-7 from the 7 with just seven seconds to play, Edelman found a some space between linebacker Dannell Ellerbe and safety Bernard Pollard and caught a touchdown pass.

Have a Ravens-related topic for Baltimore Sun columnist Mike Preston? Email your questions to sports@baltimoresun.com. Your question could appear in a Q&A with Preston later this week on baltimoresun.com.