With his “Game of Thrones” days coming to an end, Peter Dinklage now has his eye on a classic fairytale character.

Sources tell Variety that Sony is in development on “Rumpelstiltskin” with Dinklage attached to star and produce.

Patrick Ness has been brought on to pen the script with Karen Rosenfelt, Circle of Confusion’s Matt Smith and David Alpert, David Ginsberg, and Josh Weinstock also producing. Dinklage and Ginsberg with produce through their Estuary Films banner.

Sources say the film is still in deep development and would not be Dinklage’s next project after “Game of Thrones” ends. They add, however, that it is a priority for the actor and studio.

Plot details are being kept under wraps aside from the film focusing on the mythical character that Dinklage would play. The character first appeared in a Brothers Grimm tale and follows a miller who lies to the king, telling him that his daughter can spin straw into gold. The king calls for the girl, shuts her in a tower room filled with straw and a spinning wheel, and demands she spin the straw into gold by morning or he will cut off her head. When she has given up all hope, an imp-like creature, a.k.a. Rumpelstiltskin, appears in the room and spins the straw into gold in return for her necklace.

Though the return is good in the short term, Rumpelstiltskin’s motives lie in the long term and end up costing the girl more than she could have bargained for.

There have been many variations of the story over time and, most recently, the character has played a major role on ABC’s long-running series “Once Upon a Time” with Robert Carlyle playing the character.

It’s unknown if the story will be set in modern times or its original setting.

Ness is best known as the author of recent best-sellers like “Chaos Walking” and “A Monster Calls,” both of which he adapted for the screen. He is repped by CAA, Behr Abramson Levy, and Michelle Kass Associates in the U.K.

Dinklage recently hit a new milestone by recording his seventh Emmy nomination for “Game of Thrones,” the most nominations for any actor for playing the same character.

On the film side, Dinklage was most recently seen in the Oscar-nominated “Three Billboards Outside Ebbing, Missouri” and the box office hit “Avengers: Infinity War.” He can be seen next in the HBO Films pic “My Dinner With Herve.”

He is also attached to star in the dark comedy “O’Lucky Day.” He is repped by CAA and Jackoway Tyerman.