Harry Styles attends the U.S. premiere of "Dunkirk" held at the AMC Lincoln Square IMAX in New York City on July 18, 2017. (Dennis Van Tine/Abaca Press/TNS)

What’s a brash male rock star like Harry Styles up to when he covers a song like Little Big Town’s “Girl Crush”?

The hit country song — already a tangle of same-sex female attraction and jealousy — was one of the unexpected centerpieces of Styles’ tour-closing set at the Forum on Saturday.

When he brought his band to the back of the room to sing close harmonies in a tight circle — “I want her long blond hair, I want her magic touch/ Yeah, ‘cause maybe then you’d want me just as much” — the 24-year-old Brit added a new, even queerer layer to the tune.

Or maybe it wasn’t that hard a call after all.

“Eh, we’re all a little bit gay,” Styles said afterward to one fan up front holding a sign proclaiming much the same.

True enough. And what a generous, inclusive send-off to one of the best arena rock shows of the last few years.

At the start of the night, opener Kacey Musgraves was doing something much the same with her take on modern country.

Her latest LP, “Golden Hour,” has finally raised the sonic stakes of her modest but lovely and observa-tionally acute writing. Her single “High Horse” is the finest disco-country crossover, full stop, and cuts like the richly ambient, yearning “Space Cowboy” show limitless potential from here.

Onstage, her band was draped in rainbow flags, pink fringe and a mirrored disco-ball saddle. For young country fans — or any Styles-stan getting his or her first taste of Texas — it was a hell of a welcome sign.

Of all his old bandmates in One Direction, headliner Styles has made the most convincing and interesting shift to solo stardom.

On his debut album, he eschewed the svelte R&B or winsome folk-pop of his peers like Zayn and Niall Horan, opting for a warm but invigorating classic-rock aesthetic that owes more to early Rolling Stones and Kinks than anything lurking around the big Spotify playlists.

In hindsight, it was a wily subversion. Styles does indeed have moves like Jagger, and he’s clearly paid close attention to Fleetwood Mac, Prince, the Stooges and Pink Floyd on his down-time in One Direction.

Nothing is more boring than the perpetual conversation about whether rock is dead.

But if you’re gonna enter that fracas, take note — Harry Styles is probably one of the genre’s finest practitioners at the moment, and one of its most ideologically modern as well.

On Saturday, “Only Angel” was his “Start Me Up,” a rollicking opener that did more to stir the blood than a full EDM pyro budget.

He made it clear that this was going to be an old-fashioned arena rock show, with all the gifts and intentional limits of that format.

The stage production was classy and minimal, relying on the strength of the songs and Styles’ charm as a live performer.

His small band, driven by hard-swinging drummer Sarah Jones, who was captivating in her own right, was firing on every cylinder at this point in their nearly yearlong arena tour. Styles didn’t need anything more than a guitar and a mike stand (give or take a spangly gold suit) to hold the very teen crowd rapt for the whole evening.

“Medicine” and “Woman” hit the right way point of vice-dripping swagger and nice-guy-on-a-bender. But Styles knew when to slow it down and tuck into his fans’ devotion too. “Two Ghosts” was a lovely cosmic-country tune that Musgraves could probably jam on poolside at the Joshua Tree Inn, and “Sweet Creature” showed off Styles’ big range and comfort in the most intimate of arrangements.

By the night’s close, though, Styles was back in a deep, heavy groove for his hit “Sign of the Times,” and he played it well enough to slot it as perhaps the second best song with that title (more or less). He did nod to One Direction with a mod-rock take on “What Makes You Beautiful,” but before long, he was back uncorking a rowdy cover of Fleetwood Mac’s “The Chain” and his own barn burner, “Kiwi,” drawing them out for ample riffing.

At this point in his meteoric young career, Styles could do anything. So what a pleasure that he’s out here playing slashing guitar tracks, writing vulnerable lyrics and queering up arena rock for a whole new generation of open-minded, big-hearted teen fans.