Grant Gustin will play the lightning-fast character also known as Barry Allen, and appear in three episodes of "Arrow" -- including the backdoor pilot.

The Flash producers have found their speedster.

Glee's Grant Gustin has landed the key role of The Flash/Barry Allen in The CW's backdoor pilot and potential Flash spinoff, The Hollywood Reporter has learned.

Gustin will play the iconic comic book character and appear in three episodes of The CW's Arrow -- eight, nine and 20 -- the latter of which will serve as the backdoor pilot for a potential spinoff Flash series.

PHOTOS: Broadcast TV's Returning Shows 2013-14

Arrow co-creators Greg Berlanti, Andrew Kreisberg as well as director David Nutter are behind the potential spinoff. Berlanti, Kreisberg and DC Entertainment's Geoff Johns -- a writer/consultant on Arrow -- will pen the script for Warner Bros. Television; Nutter will direct.

The potential Flash spinoff will be an origin story similar to what producers did with Stephen Amell starrer Arrow. All three Barry Allen episodes will be penned by Berlanti, Kreisberg and Johns.

"When we first meet Barry Allen, he's just a forensic scientist … an ordinary man," Kreisberg told reporters in July when the project was first announced. The character, like Amell's vigilante, will be grounded in reality and as realistic as possible. The first two episodes will see the character in Queen's home of Starling City, with the 20th providing a window to see Barry in The Flash's world.

Barry Allen is described a Central City assistant police forensic investigator who arrives in Starling to look into a series of unexplained robberies that may have a connection to a tragedy in his past. A comic book fan boy, Barry is obsessed with the Arrow unaware that working with Oliver and Felicity to solve the crime has brought him right into the dangerous world of the vigilante.

"Part of the fun for the audience … is to see how we view our Arrow take on the Flash legacy," Kreisberg said. "Some of it will feel very familiar to DC Comics, some of it hopefully will feel different, fresh and exciting. The same way we approached Arrow is the same way we're approaching Barry."

PHOTOS: Faces of Fall TV 2013

One of the things that grounds The CW's Arrow is the fact that the series isn't about individuals with superpowers -- with The Flash a clear violation of that. Producers noted that they will handle the introduction of Barry's superspeed in a way that isn't commonplace. "There will be extraordinary events in the world and the characters will react in the same way," Kreisberg noted.

Added Johns: "We're also exploring a very personal story for Barry -- life as a forensic scientist and the people around him, the tragedies and how he deals with them -- in a very different way than Oliver Queen. The intention, they noted, will be to add to Arrow instead of stripping away characters from the series should the spinoff move forward, meaning it's likely the residents of Starling City will remain there.

For Gustin, the role reunites him with The CW, where he most recently had a multiple-episode arc on the final season of 90210. His breakout role came on Fox's Glee, where he recurred as a member of the all-male group the Warblers. His credits also include CSI: Miami and the Lifetime telepic A Mother's Nightmare. He's repped by Robert Stein Management and CESD.

“I’m unbelievably excited. I’ve been a lifelong fan of DC Comics, so I can’t be more honored and can’t wait to get started," Gustin told THR.

What do you think of the casting? Hit the comments below with your thoughts. Arrow returns Oct. 9 on The CW.

E-mail: Lesley.Goldberg@THR.com

Twitter: @Snoodit