Republican U.S. presidential candidate Ted Cruz gestures at rival Donald Trump at the U.S. Republican presidential candidates debate in Detroit on March 3. (Jim Young/Reuters)

NEW YORK — Trailing Donald Trump badly in the polls with four days left until the New York primary, Ted Cruz is trying to diminish his Republican presidential rival by tying him to his new favorite political target: New York City Mayor Bill de Blasio.

An aggressive new TV ad released Friday by the Texas senator's campaign weaves together negative headlines about the Democratic mayor with audio of Trump praising him.

The commercial shows tabloid newspaper pages about crime in the city and violence against police officers under the mayor's watch. "He'll end up being a good mayor — maybe a very good mayor," Trump is heard predicting in the commercial. The audio appears to be from a 2013 radio interview.

The Cruz campaign said the ad is airing statewide. But his campaign did not immediately respond to a request to provide the exact size of the buy.

Polls show Cruz trailing Trump by a wide margin ahead of Tuesday's vote. Campaigns don't typically spend big bucks on TV ads in the closing days of contests they stand little chance of winning.

Earlier this week, Cruz put out a radio ad proudly trumpeting de Blasio's criticism of him. The two have exchanged bitter attacks in recent weeks.

A Trump spokeswoman did not immediately comment on Cruz's ad. At the New York State Republican gala in Manhattan on Thursday evening, Trump, a New York resident, panned de Blasio's job performance.

"It's a vibrant city, an amazing city — we have to be careful," he said. "Our mayor has to be careful because he could blow it very quickly if he keeps going the way he's going. Not doing good. You better be careful, Mr. Mayor. But we have a city that outlasts the mayors, it outlasts everybody, it's going to outlast us. It's one of the great, great cities of the world and it's called New York City."

Jenna Johnson contributed to this report.