The Times Square Elmo who terrorized tourists with anti-Semitic rants faces up to two years in prison for trying to extort $2 million from the Girl Scouts, prosecutors said Wednesday in Manhattan court.

Transient loon Dan Sandler, 50, who also uses the name Adam Sandler, was arrested in May after he threatened to spread false rumors that the Girl Scouts of America set up sexual encounters between adult men and underage girls unless the company paid up, prosecutors charged.

He pleaded guilty to attempted grand larceny and misdemeanor stalking before Manhattan Supreme Court Justice Robert Stolz Wednesday as part of plea deal with prosecutors.

The kooky faux “Sesame Street” character is expected to get a year on each count.

The evil Elmo sent dozens of emails to a supervisor at the organization’s West 23rd Street headquarters where he did performed administrative work years earlier.

“I will show up at Girl Scout functions and other places that parents and kids congregate and hold signs, connecting the Girl Scouts with the Cambodian Rape Camp man,” he wrote in one menacing missive referencing himself.

Sandler was arrested in Cambodia for running a live-porn Web site there called, “Welcome to the Rape Camp,” prosecutors said.

Last year Sandler was arrested in Times Square in full Elmo regalia screaming, “The Jews are responsible for everything that’s wrong with the world!” and “I hate Jews!” as he begged for tips.

He returns court October 9th for sentencing.