BALTIMORE — The San Francisco 49ers proved Sunday they can hang with an elite team on the road.

Next step? Showing they can beat the NFL’s best away from home.

“We had every chance to win that game,” 49ers coach Kyle Shanahan said after absorbing a 20-17 loss to the Ravens.

With both teams now standing at 10-2, who’s to say there won’t be a Super Bowl rematch?

“Hopefully, we can earn an opportunity to maybe get the chance to play them some other time again,” Shanahan said.

Rather than look too far ahead, the 49ers will turn their immediate focus toward facing another team with championship aspirations. On Sunday, San Francisco plays in New Orleans against the Saints (10-2), who have already clinched the NFL South.

The winner gets the edge on claiming home-field advantage in the NFC playoffs.

Saints quarterback Drew Brees will present the 49ers’ defence with a more traditional challenge. The veteran pocket passer will be a welcome sight after they were forced to deal with Baltimore’s Lamar Jackson, a dual threat who made San Francisco alter its usual tactic of relentlessly pressuring the quarterback.

Jackson passed for 105 yards and a touchdown and ran for 101 yards and a score. He directed the decisive drive, a 12-play, 34-yard march that culminated in a 49-yard Justin Tucker field goal as time expired.

The possession lasted nearly 6 1/2 minutes. Jackson went 3 for 3 for 27 yards and used his legs to convert on third down and fourth down.

“He’s going to make some plays,” Shanahan said of Jackson. “We had to change some stuff up and run some fronts a little bit different. I was happy with the scheme we put in, how the guys executed it.”

Still, it must be noted that San Francisco came in with the league’s top-ranked defence and a unit that forced an NFL-best 36 three-and-outs.

Baltimore didn’t go three plays before punting even once.

Both teams played at their best in a steady downpour, producing a game that lived up to its advance billing.

“It was amazing. It was like a playoff atmosphere,” said 49ers safety Marcell Harris, who forced Jackson into his first lost fumble of the year.

Not that the weather bothered Harris, who’s surely seen similar rain and wind on more than one occasion in raw San Francisco.

“It wasn’t that bad,” he said. “I know it was raining and kind of cold, but at the end of the day, it’s ball.”

San Francisco's rushing attack, second in the league entering play Sunday, stalled early in a driving rain before Raheem Mostert energized the offence. Mostert ran for a career-high 146 yards and scored a touchdown on a 40-yard jaunt against the Ravens, one of three teams he played for in his rookie year of 2015.

“I really wanted to show the organization what they were missing out on,” he said.

Jimmy Garoppolo went 15 for 21 for 165 yards with a touchdown, no interceptions and a lost fumble.

He’s done better, but rarely has the quarterback played in conditions this bad.

“Obviously, today’s conditions didn’t favour him, and he still went out and battled it out. I’m happy for him, proud of him,” said wideout Emmanuel Sanders, who had four catches for 41 yards.

Despite the loss, the 49ers showed the rest of the NFL that they can compete with the best team the league has to offer. Their only two defeats, to Seattle and Baltimore, both came on a game-ending field goal.

“We believe in ourselves, even when people outside the locker room don’t really believe in us and call us pretenders,” Mostert said.

___

More AP NFL: https://apnews.com/NFL and https://twitter.com/AP_NFL