GREEN BAY — At midweek, when the topic of the Cincinnati Bengals being the only NFL team he’d never beaten — other than his own Green Bay Packers, of course — came up, Aaron Rodgers made a joke.

“I’ve beaten the Packers a few times,” Rodgers corrected with a smirk. “I had a couple of bad games.”

And as he and his team were being booed off the field down by a pair of touchdowns — including one on a Rodgers pick-six, something almost as rare as a unicorn — on Sunday afternoon, it felt to the Packers’ two-time NFL MVP quarterback that the joke might be on him.

“Obviously, the fans weren’t too happy about it,” Rodgers said. “It’s not great getting booed, but hey, we understand it. Fans have every right to do that. And I would’ve booed, too, probably, watching that first-half performance.”

But then, on a 75-yard odyssey en route to the game-winning touchdown, and again on a 72-yard Geronimo Allison catch-and-run on Rodgers’ specialty — a free play — to set up Mason Crosby’s winning 27-yard walk-off field goal in overtime, Rodgers was Rodgers again. And as a result, the Packers persevered to a 27-24 victory over the Bengals at Lambeau Field.

“He stays steady on any roller coaster,” tight end Lance Kendricks said. “I’m just glad to be a part of it.”

Or, as Crosby put it, “He just did his magic.”

That he did, and all it took was Rodgers getting his team to the OT session — and his defense getting him the ball for a chance to conjure up that magic.

Before Sunday, the Packers had been an astonishing 0-7 in overtime games with Rodgers’ at quarterback — their most recent overtime victory, in 2007 at Denver, came with Brett Favre at quarterback; the most recent time they went to overtime and didn’t lose, in 2013 against Minnesota, was when Rodgers was out with a broken collarbone and Matt Flynn rallied them to a tie.

Of those seven overtime failures, three had come in the playoffs (2009 NFC wild card at Arizona, 2014 NFC Championship at Seattle, 2015 divisional at Arizona) and four had come without Rodgers ever getting a chance to touch the ball.

“Obviously, in overtime over the years, I haven’t had a lot of opportunities to throw the ball. I’ve heard I had like six pass attempts coming into this game in overtime,” said Rodgers — who’d heard that statistic correctly. “So I was glad that after we lost the toss … we had a nice three-and-out there to get us the ball back right away.”

The defense, playing without defensive tackle Mike Daniels, outside linebacker Nick Perry and No. 1 cornerback Davon House, allowed only a field goal during the second half, limiting the Bengals (0-3) to just 108 net yards after halftime. But the unit’s finest moment came after the Bengals won the toss.

On the first play from scrimmage, inside linebacker Blake Martinez met running back Joe Mixon and drilled him for a tone-setting 2-yard loss. After a 6-yard Andy Dalton completion to A.J. Green, the Bengals faced third-and-6 from their own 29-yard line. And when Dalton threw quickly to tight end Tyler Kroft, rookie safety Josh Jones —in the midst of a 12-tackle, two-sack performance — was there to make the immediate tackle after a 1-yard gain.

The Packers got the ball and watched as Rodgers threw incomplete to wide receiver Jordy Nelson and running back Ty Montgomery on the first two plays. Then, on third-and-10 from his own 21-yard line, he got Bengals defensive end Michael Johnson to jump offside, alerted his receivers to convert their routes to vertical go routes, and calmly hit second-year wideout Geronimo Allison in stride across midfield at the Cincinnati 44. Allison juked and spun his way down to the Cincinnati 7 — a 72-yard gain.

“I saw the flag thrown, so I was looking down the seams first,” Rodgers said. “You play this game long enough, some weird stuff happens sometimes on the field. About a split second before I threw that ball, I had an image of a pass I threw to James Jones against Detroit. It was actually an 80-yard touchdown (in that game, in 2013). So that kind of flashed right away about how hard to throw that one, and luckily, I put it in a good spot, and G-Mo did the rest.”

After Rodgers maneuvered a few steps to his right to center the ball for Crosby, the veteran kicker booted his 27-yarder to win it.

“Obviously as soon as we force them to punt and get the ball back, I have no doubt we’re going to get a chance (to kick). You just don’t know how long it’s going to be,” Crosby said. “I’ve been so fortunate to watch that offense for all these years and just know that in that situation I get myself to have an opportunity to win the game. Another special night.”

Of course, for that to happen, first the Packers had to get to overtime — and they did because of the masterful drive Rodgers engineered at the end of regulation.

Before that, the Packers had managed just 199 yards of total offense.

“I saw no panic,” Rodgers said of his team down the stretch. “I think the defense felt pretty good about how they were playing. They had given up 14, and I had given (Cincinnati) seven.”

As soon as Rodgers hit Allison for a 17-yard gain to start the drive — and came back to him for an 11-yard completion on third-and-9 after a drop the play before — the Packers were off and running.

That got the Packers across midfield, and Rodgers got them across the goal line with a bold throw to Nelson — an out-breaking route similar to the one that was intercepted and returned for a touchdown earlier in the game. This time, cornerback Dre Kirkpatrick was a tick too slow, and Rodgers’ perfectly-thrown pass — and Crosby’s ensuing extra point — forced OT.

“I thought Aaron played one of his best games. I thought he was tremendous today. He had a lot to deal with,” Packers coach Mike McCarthy said. “It took us a while to get going, but I thought he handled the adjustments very well. I thought he had a heck of a game.”