Published in 1982, Dahl's beloved children's book tells the story of a young orphan (Barnhill) who teams up with a benevolent giant and the queen of England to save the world from evil, man-eating behemoths.
"The BFG" marks the first feature-film role for Barnhill, who has been acting for two years and will appear in the upcoming British children's TV series "4 O'Clock Club."
"After a lengthy search, I feel Roald Dahl himself would have found Ruby every bit as marvelous as we do," Spielberg said in a statement.
Production on "The BFG" is scheduled to start early next year. The film is slated to open July 1, 2016, with Disney distributing in the U.S.