Harry Styles is one of the most famous musicians on the planet, and this year, he will become a bonafide movie star.

Having previously appeared in Christopher Nolan’s 2017 war drama “Dunkirk,” Styles has now taken on two leading roles: Olivia Wilde’s “Don’t Worry Darling,” in theaters Sept. 23, and “My Policeman,” which Amazon Studios will release on Oct. 21.

In “Don’t Worry Darling,” Styles plays Jack, the on-screen husband to Florence Pugh’s Alice. But he doesn’t just act in the upcoming psychological thriller — Variety can reveal that Styles also brought his musical talents to the film, writing a key song in the movie.

In “Don’t Worry Darling,” Alice is heard humming a mysterious tune, which is featured prominently throughout, essentially serving as the movie’s theme song.

Wilde tells Variety, in this week’s cover story, that Styles offered to write the melody. In the script, it was originally described only as “the trigger song.”

“In prep,” Wilde says, “Harry called me and said, ‘What’s the trigger song? Like, what’s the melody?’ I said, ‘I don’t know. I’m going to different writers to write it. Do you have anything in mind?’ And he said, ‘I’ll think about it.’” She continues, “Five minutes later, he sent me a demo from his piano, and it was what ended up in the film. He called me and said, ‘What about this?’ And I was like, ‘Yeah, that’s it. That’s it. And that’s really insane that you did that in five minutes.’”

Styles tells Variety about his creative inspiration behind the song: “I wanted something that could be both sweet and creepy, entirely dependent on the context.”

“I remember first playing it on the piano, and it had a sort of homemade nursery rhyme feel to it,” Styles says. “Applied to the different moments in the film, I think it takes on a couple of different lives — I hope.”

On screen, Styles doesn’t sing, but he does dance.

Styles’ character tap dances in one scene, opposite Chris Pine’s Frank. And now, Styles confirms that really was him tap dancing — not a body double.

“’Twas I, tap-dancing,” Style says. “I feel like I’ve been waiting for someone to require a 35-second tap routine from me my whole life.”