In one of the most exciting games of the season, the Ravens pulled out a miraculous 34-31 victory over the Cowboys on the final play in Brazil.

Kicker Tyler Loop, who grew up in the Dallas area and had to live the offseason with a missed kick that ultimately kept the Ravens out of the playoffs, nailed a 56-yarder with no time left.

After a touchback on the kickoff, the Ravens got the ball back with only seven seconds left. But Lamar Jackson worked his magic, connecting with Zay Flowers for a 27-yard gain to the Cowboys 38. The Ravens got a timeout with one second left.

It was the third lead change in the final two minutes and improved the Ravens’ record to 2-1 and dropped the Cowboys to 1-2.

First, Ravens rookie tight end Matt Hibner scored on a 2-yard pass from Jackson on third down to give Baltimore a 31-28 lead. It was too much time for Dak Prescott and the Cowboys.

Dallas got a gift from the officials on the nine-play, 60-yard drive.

Ravens cornerback Nate Wiggins was in position for an interception with 23 seconds left, but Cowboys wide receiver CeeDee Lamb hooked Wiggins’ arm. The CBS crew argued that it should have been offensive pass interference. Instead, officials threw the flag on Wiggins, giving the Cowboys the ball at the 2.

A false start on tight end Luke Schoonmaker kept the Cowboys from a game-winning touchdown with two Prescott incompletions sandwiched between a 2-yard scramble.

Brandon Aubrey kicked a chip-shot, 23-yard field goal with seven seconds left. That proved too much time for Jackson and the Ravens.

The Cowboys stopped the Ravens twice on fourth down, and the Ravens stopped the Cowboys once on fourth down. The Cowboys had a field goal blocked and lost a controversial fumble that looked like it might have been an incompletion.

The Cowboys outgained the Ravens 415 to 378 yards.

Jackson was 15-of-20 for 186 yards and two touchdowns and ran for 50 yards on six carries. Zay Flowers catching five passes for 84 yards. Derrick Henry rushed for 89 yards and two touchdowns on 26 carries.

Prescott went 25-of-40 for 276 yards and a touchdown. Lamb caught seven passes for 112 yards and George Pickens added seven receptions for 82 yards. Javonte Williams rushed for 98 yards and a touchdown on 19 carries.

Both teams had a number of significant injuries.

The Ravens lost their top two centers late in the game, with both carted to the training room. The absences of Jovaughn Gwyn (ankle) and Ethan Pocic (knee) forced rookie right guard Olaivavega Ioane to move to center.