Confirming rumours from last month, Variety reports that Gyllenhaal will play Dastan in the video game adaptation.
The story revolves around a prince who tries to prevent the Sands of Time, a gift from the gods that can reverse time, from falling into the hands of an evil nobleman.
Quantum of Solace Bond girl Gemma Arterton has been cast as Tamina, an exotic princess who helps Dastan.
Mike Newell will direct the film from a script by Doug Miro, Carlo Bernard, Boaz Yakin and the game's creator Jordan Mechner. Jerry Bruckheimer is on board to produce.
Speaking about the casting of Gyllenhaal, Bruckheimer said: "He's a wonderful actor. He's someone I've been watching for a long time and somebody I've always wanted to work with."