Martin Scorsese has closed his deal with Red Granite Pictures to direct “The Wolf of Wall Street,” starring Leonardo DiCaprio. Lensing will begin in August in New York.

Red Granite announced Thursday that Scorsese had come onboard, a month after reps for the director had started talks.

It’s the fifth collaboration between Scorsese and DiCaprio after “Gangs of New York,” “The Aviator,” “The Departed” and “Shutter Island.”

Scorsese was originally attached to the Jordan Belfort biopic five years ago, when it was set up Warner Bros. a few months after “The Departed” won the Oscar for best picture, but the director subsequently fell out. Scorsese again committed to direct in February 2011 but then began working on “Hugo” and was no longer attached when Red Granite announced last May at Cannes that it had come aboard to finance “Wolf.”

Red Granite principals Riza Aziz and Joey McFarland are producing along with DiCaprio via Appian Way, Scorsese and Emma Koskoff at Sikelia and Alexandra Milchan at Emjag. Irwin Winkler and Georgia Kacandes will exec produce.

DiCaprio has long been attached to star as Belfort. Terence Winter wrote the screenplay, which chronicles Belfort’s rise and fall on Wall Street, along with his hard-partying lifestyle and tumultuous personal life, which included drug addiction.

Belfort was indicted in 1998 for securities fraud and money laundering and spent 22 months in federal prison.

Scorsese is represented by WME and manager Rick Yorn. Yorn also represents Leonardo DiCaprio. David Boyle of Red Granite negotiated both Scorsese and DiCaprio’s deal on behalf of the company.