'Making History' star Adam Pally arrested for misdemeanor drug possession

"Making History" and "Happy Endings" star Adam Pally was arrested Tuesday night in New York and hit with two misdemeanor drug possession charges, a New York Police Department spokesperson confirmed to Variety.

A source tells Variety that Pally was seen smoking marijuana with an e-cigarette in the neighborhood of Hell's Kitchen in public view at about 10:46 p.m. When police arrested him, they found that he had a small bag of cocaine, and cited him with the second drug charge. He's since been released from custody.

Related: Rachel Bloom, Adam Pally to Star in Comedy 'Most Likely to Murder'

He has been charged with criminal possession a controlled substance in the 7th degree, and criminal possession of marijuana in the 5th degree. Pally's ticket requires that he appear in front of a judge within 30 days.

His reps did not immediately respond to request for comment on Wednesday. TMZ first broke the news of the arrest.

Pally is best known for his role as Max Blum on ABC comedy "Happy Endings," which was canceled after three seasons in 2013. He also plays Dr. Peter Prentice in Mindy Kaling's "The Mindy Project," and currently stars in the Fox comedy "Making History."

His other credits include "Search Party," "Iron Man 3," "Dirty Grandpa," "The To Do List," and "Taking Woodstock."