When Nick Foles went down with a broken collarbone in the season opener, the Jacksonville Jaguars needed a leader, the kind of quarterback who could come through in a trying situation. So they turned to a rookie, a sixth-round selection who became the first 2019 draft pick to take a snap in a season marred by quarterback injuries.

What they got with that 178th overall pick is a 23-year-old Mississippian with a bushy mustache, a mop of hair and an array of headbands, a guy who became a legend in Pullman, Wash., for his prowess on the field and the way he helped Washington State heal after the death of its quarterback. His nearly nude workouts in the weight room might get the headlines, but the legend of Gardner Minshew II does not end there.

He brought all of that into prime time Thursday night, when the Jaguars knocked off the Titans, earning their first win of the season. Minshew threw a pair of first-quarter touchdown passes and finished 20 of 30 for 204 yards, outplaying former second overall pick Marcus Mariota. And then he brought his eccentricities onto NFL Network’s postgame set, explaining his famous stripped-down workouts by saying “you don’t want any friction or inhibition from clothes” and facing a panel of analysts wearing fake mustaches.

“It was kind of a silly thing we started at camp at Washington State and everybody quit on me,” he said, explaining his facial hair. “So I was like [forget] y’all, I’m doing this longer than everybody. And here we are.”

Minshew nearly got the Jaguars their first win last Sunday, but a two-point conversion that would have beaten the Houston Texans failed. In his first game, against the Kansas City Chiefs, Minshew completed 88 percent of his passes, the highest in NFL history for any player with at least 15 attempts making their NFL debut. Through his first two games, he had completed 45 of 58 passes for 488 yards and three touchdowns.

“What’s the saying? You better be ready for the opportunity of a lifetime during the lifetime of the opportunity,” his mother, Kim, told the Spokesman-Review in January. “And he’s always been ready to take advantage of that.”

Where to begin with someone who shows the kind of personality sometimes unwelcome in the NFL? Let’s start with his look. Minshew became a social media phenom when he arrived for a game at Christmas last year wearing one of the most over-the-top outfits a QB has donned since the days of Joe Namath and his fur coat. It was a reddish suit, complemented with a white belt (of course), a shirt (we hope it was polyester) open to his sternum (revealing a thicket of chest hair), with a manly chain of a necklace and, duh, aviator shades on his unshaven and mustachioed face.

For his first regular-season road trip as a rookie, he was more low key, sporting a denim look.

But who is the man behind the mustache and the partially clothed workouts? (That’s right. He often has hit the weights wearing only a jock, shades and, of course, the headband. And sometimes he leaves out the jock.)

A Brandon, Miss., native, Gardner Flint Minshew II could have come into the world as Beowulf Minshew if not for the good sense of his parents. “My dad wanted to name him Beowulf,” his father, Flint Minshew, told the Spokesman-Review last spring, “and that’s about as far as that got.”

He spent his first year of college at Troy on an academic scholarship in 2014, transferred to Northwest Mississippi Community College for a year and then moved to East Carolina in 2016, graduating in December 2017. Although he initially planned to attend Alabama, Washington State Coach Mike Leach made him an offer he could not refuse.

“Do you want to be a backup at Alabama or lead the nation in passing?” Leach asked. “We’re going to lead the nation in passing one way or another.”

As a graduate student, he was immediately eligible to play behind the Cougars’ projected starter, Tyler Hilinski. But Hilinski died by suicide in January 2018, and Minshew stepped up in an incredibly difficult situation. He was a nice fit for more than just Leach’s offense.

“It was time for that community, going through a lot of healing with the passing of Tyler Hilinski,” Minshew told reporters last week. “Just really trying to honor that legacy and bring hope to a community that was pretty down.”

He passed for 4,770 yards and 38 touchdowns with nine interceptions, setting school and conference records for completions for the 11-win team and finishing fifth in the Heisman Trophy balloting. His mustache, and his reputation, kept growing in Pullman, with fans wearing fake ones to games.

Minshew reportedly had the second-highest Wonderlic score among quarterbacks eligible for the draft last spring, and with Joshua Dobbs signing as his backup, he was asked recently if he and Dobbs, who has a degree in aerospace engineering, combined to give the Jaguars’ quarterbacks room the highest IQ in the league.

“He’s kind of in his own deal, man. I’ve got a communications degree. I know y’all know about it,” Minshew told reporters with a laugh. “I belong in this [media] room more than that one.”

And those naked workouts? “That’s some college thing,” running back Leonard Fournette said with a laugh. “That’s his ritual, and I’m used to it now. Whatever makes him throw 88 percent [completions], he can have it. So I’m not going to stop him.”

If everyone is talking about Minshew’s mustache, his workout and travel attire, that’s fine with Jaguars Coach Doug Marrone. Foles is not expected to return until at least Week 11 after having his collarbone surgically repaired with a plate and screws stabilizing the break.

“If we can talk about [his mustache], then I know he’s playing well,” Marrone told reporters. “If he doesn’t play well, then I know we won’t be talking about his mustache.”

The message hadn’t changed after Thursday’s win.

“It’s all good,” Marrone said, describing what Minshew has brought to the team. “I really think it’s good. Actually, it’s remarkable, to be honest with you.”

Read more on the NFL from The Post: