New York City mayor Bill de Blasio warned Ted Cruz to "be careful" when attacking New York Democrats with a history of "scandals."

Asked about Cruz's decision to discuss "New York values" and his references to Democratic politicians such as Anthony Weiner and Eliot Spitzer, de Blasio cautioned the Texas senator against adopting a double standard. Weiner resigned from Congress following a sexting scandal, while Spitzer left the governor's office after a prostitution scandal.

"I think he [Cruz] should be careful, the Republican Party has had plenty of problems, scandals, corruptions, corruption I should say, many instances that we can point to," de Blasio said. "I think what Ted Cruz is trying to do is play it both ways. He says 'New York values,' he doesn't say he disagrees with progressives or with any individuals' philosophy. He paints the whole people of New York with a broad brush again because that's how he appealed for money for his donors around the country."

The Democratic mayor told CNN that Cruz will suffer mightily in the Empire State's GOP primary for denigrating "New York values" on the presidential campaign trail. He also said he agreed with Donald Trump when the Republican front-runner chose to defend the honor of New York against Cruz, who de Blasio described as "out of touch."

"Ted Cruz insulted the people of New York when it was politically convenient," de Blasio said. "You know what, Ted Cruz thinks he's smart, but the people of the City of New York are going to see through him. Now he's trying to redefine what he said. But back then it was bluntly a regional appeal. He was trying to somehow cast negative aspersions on Trump because he came from New York, well guess what? The New York primary is suddenly a lot more important than Ted Cruz might have imagined and now he'll pay the price for it."

Cruz campaigned in Scotia, N.Y., on Thursday morning ahead of a visit to Brooklyn in the afternoon. The New York primary will take place on April 19.