Mayor Bill de Blasio continues to stick city taxpayers with his security bill while traveling out of state on his quixotic presidential bid, while small-city mayor and rising Democratic star Pete Buttigieg’s campaign pays for his protection.

De Blasio’s security detail is provided by a dedicated unit of the New York City Police Department that accompanies the mayor virtually everywhere — including when he travels out of state for his campaign.

The NYPD has repeatedly refused to reveal how much taxpayers are spending for city police to protect Hizzoner as he travels through Iowa, South Carolina and other early voting states.

De Blasio’s campaign referred questions to City Hall.

“The Mayor of New York City, as a matter of safety, requires a security detail wherever he is. Mayors have always traveled and their detail has always gone with them paid for by the city as part of their day-to-day duties,” said press secretary Freddi Goldstein.

De Blasio’s position is not unprecedented.

New Jersey taxpayers picked up the cost of Gov. Chris Christie’s security costs when he ran for the Republican presidential nomination in 2016 and Texas taxpayers picked up the security detail costs for then-Gov. Rick Perry’s failed 2012 White House bid.

But unlike de Blasio, Buttigieg does not have a police detail or even an officer assigned to him full time — even when he’s back home in his small city of South Bend, Ind. He only occasionally receives police protection when he attends events in the city, his campaign confirmed.

That means Buttigieg’s campaign hires security contractors to provide security for the 37-year-old politician on the campaign trail and when he is back home.

The campaign told The Post it spent roughly $135,000 on protection between April and June.

News nonprofit The City first reported the disparate behavior.