Jacksonville’s Jeremy Mincey celebrates after a tackle as his team holds the Ravens to just one touchdown in the game. (Scott Cunningham/GETTY IMAGES)

What was an opportunity to show a national television audience that they are one of the league’s elite teams — and match their best start since their Super Bowl season of 11 years ago — turned into a nightmare for the Baltimore Ravens on Monday night, a game that featured untimely penalties, a blatant disregard for the football and one of the worst offensive performances in team history.

In a 12-7 loss to the Jacksonville Jaguars, the Ravens gained a franchise-worst 16 net yards in the first half and didn’t get a first down until nearly 40 minutes had elapsed in the game.

“It’s about as bad as you can play on offense,” Coach John Harbaugh said. “I don’t know if we could play any worse than that until that [late] drive.”

The Ravens (4-2) avoided their first shutout since Week 2 of the 2002 season when Joe Flacco threw a five-yard touchdown pass to Anquan Boldin with 2 minutes 2 seconds left.

Baltimore then recovered the onside kick, but Billy Cundiff’s kick didn’t go the required 10 yards before Haruki Nakamura recovered it. The Jaguars turned the good field position into Josh Scobee’s 51-yard field goal, his fourth of the night and his third beyond 50 yards.

Trailing by five, the Ravens had the ball on their own 20 with 1:43 left, but Joe Flacco was intercepted by Drew Coleman on the second play.

“You feel like you are going to find a way to win the game, especially with the way our defense was playing,” Harbaugh said. “Obviously, we were right in the game. We just came up short.”

The Jaguars (2-5) had lost five straight games and seven of their past eight to the Ravens.

Just like he was in an earlier prime-time game against the Jets, Flacco looked confused and overwhelmed for the majority of the contest. He went just 21 for 38 for 137 yards, one touchdown and one interception. He didn’t direct one extended drive until about midway through the third quarter.

““Bad football for much of the game except for that three-minute span where I thought we played all right,” Flacco said. “But that’s not a good percentage when you play a 60-minute football game.”

While much of the attention will inevitably be on his poor performance, Flacco had plenty of company. Running back Ray Rice rushed eight times for just 28 yards and fumbled once, breaking his streak of 522 regular season touches without a fumble.

Boldin was blanketed all night by Rashean Mathis and didn’t catch his first pass until the 5:58 mark of the third quarter. One play later, Rice rushed 12 yards to give the Ravens their initial first down of the night.

“They basically beat us with their defense,” Harbaugh said. “They deserved it.”

The Ravens’ offensive line was overpowered repeatedly, allowing three sacks and numerous other hits on Flacco, and failing to open any holes in the running game.

The defense was mostly solid, harassing rookie Blaine Gabbert for much of the night. But forced to be on the field for such long stretches without much of an interruption, the Ravens allowed Maurice Jones-Drew to rush for 105 yards on 30 carries.

A running into the kicker penalty on Paul Kruger led to the second of Josh Scobee’s 54-yard field goals in the first half, and an unnecessary roughness penalty on safety Bernard Pollard prolonged the Jaguars’ opening drive of the third quarter, leading to another field goal.

“You got to play well, you got to do things right and execute,” Flacco said. “We don’t need a wakeup call. We’re really not a team that needs that. That’s tough to explain, but we have a great group of guys in there. We just didn’t play well tonight.”