His dog made him do it.

A former Morgan Stanley investment manager accused of secretly videotaping romps with three women claimed the camera was only intended to monitor his pooch.

“I have this camera set up in my apartment to watch my dog when I’m not there,” John C. Kelly told investigators on Feb. 26, according to court papers made public Thursday. “It’s on and sometimes stays on. So I accidentally recorded myself having sex because it’s always recording.”

Kelly, the son of noted defense lawyer John Q. Kelly, was arraigned in Manhattan Supreme Court Thursday and pleaded not guilty to 19 counts of unlawful surveillance and attempted unlawful surveillance.

Kelly’s lawyer Ben Brafman implied that the victim only lodged the complaint against his client after he’d had her arrested for trashing his apartment.

The handsome financier has been under investigation for nearly year for making the creepy recordings between May of 2011 and December of 2012.

He was arrested Nov. 8 and released on his own recognizance.

Daniel Parker, the defense lawyer for one of the victim’s, said Kelly posted the illicit videos on Internet sites.

“He used an elaborate system of surveillance using multiple devices in both his bedroom and their homes,” said Parker. “He left a trail and it was on YouTube and Vimeo.”

Kelly used a hidden camera, a web cam and a stealth phone app to film the women engaged in various sexual acts. He even installed a hidden camera in the bookshelf of his East 69th Street apartment, Park said.

The victims delivered the video footage to the Manhattan District Attorney’s Office prompting the investigation.

Kelly’s father represented the estate of Nicole Brown Simpson and the mother of Natalee Holloway, the Alabama teen who disappeared in Aruba in 2005.