Two men are under arrest after they used a dog as their drug mule, hiding more than $1 million worth of heroin in the pooch’s crate in a shipment from Puerto Rico to Kennedy Airport, officials said Monday.

The shipment containing 22 pounds of heroin was seized Friday night as one of the suspects tried to wheel the crate — dog and heroin inside — out of the American Airlines air cargo site at the airport, Queens District Attorney Richard A. Brown said in a news release.

Arrested were Samuel Seabrooks, 35, of the Bronx, and Carlos Betancourt-Morales, 27, of Carmel in upstate Putnam County, prosecutors said.

NYPD Animal Cruelty Investigation Squad Det. Charles Cadiz conducted the court-ordered search, recording 10 bricks of heroin, each stamped with a Nike swoosh emblem and marked with a five-pointed star, officials said. The search was under the direction of Commanding Officer Sgt. Michael Murphy and Deputy Chief James Luongo,

Betancourt-Morales had signed for the dog crate at the cargo pickup site, following an earlier meeting with Seabrooks at an International House of Pancakes restaurant in the Bronx, prosecutors said. Betancourt-Morales was attempting to wheel that crate out of the terminal building at Kennedy when he was stopped by police — as Seabrooks waited in a nearby vehicle, prosecutors said.

“It’s alleged that man’s best friend was used in an attempt to smuggle drugs into the city, but great police work led to the seizure of more than 10 kilograms of heroin concealed within a dog crate,” Brown said in a statement released Monday. The men “are alleged to have conspired to bring the drugs to New York City and elsewhere.”

Betancourt-Morales and Seabrooks were arraigned Sunday night before Queens Criminal Court Judge Gia Morris on a complaint charging them with first-degree criminal possession of a controlled substance and second-degree conspiracy. The two were ordered held on $250,000 cash bail or $500,000 bond and are next scheduled to appear in court on April 10, Brown said.

If convicted, the two men each face up to 20 years in prison. The dog, described as a Shepherd-type/mixed breed, is in the custody of the American Society for the Prevention of Cruelty to Animals, prosecutors said.

Correction: The breed of dog — information provided by the Queens district attorney’s office — was incorrect in a previous version of this story.