Chief of Counterterrorism James Waters, two counter- terrorism lieutenants and a sergeant finally made it to war-torn Afghanistan earlier this month on what the NYPD said was a training mission for Afghan military and law enforcement.

But division Capt. Daniel Magee and Deputy Chief Scott Shanley were left behind. The two had been tossed off an Aug. 10 military charter to Afghanistan for drunkenness, leading Waters to abort that mission. An NYPD internal investigation followed.

“There was no sense sending the two people who were the subjects of the investigation on the trip while the investigation was still pending,” an NYPD official said last week on the condition of anonymity to explain why Magee and Shanley didn’t go on this month’s trip.

The NYPD has acknowledged that, before boarding the Aug. 10 charter, Waters, Magee and Shanley had gone for “a few beers” at the Baltimore-Washington International Airport at night after their flight was delayed.

But contrary to media reports that Magee and Shanley had started an argument with the crew inside the plane, department officials maintain the two fell asleep in their seats and did nothing wrong to warrant their removal. At the time, a top NYPD official said they were ordered off the plane because the crew maintained what the official called “strict military protocol.”

“Nobody ever made allegations to the NYPD or to Waters that anybody engaged in misconduct or in an encounter with any human being,” the official said then.

That interpretation led to the internal probe conducted not by the NYPD’s Internal Affairs Bureau, but by Waters’ boss, Deputy Commissioner of Intelligence and Counterterrorism John Miller. That meant the investigation was kept in house. It also ensured Waters would not face serious discipline, if any, for failing to limit the subordinates’ drinking.

Some at the NYPD have suggested that by being left out of this month’s trip, Magee and Shanley are being scapegoated to protect Waters, whom Miller has approvingly called a “guided missile” — someone who effectively does whatever he is ordered to do.

As Roy Richter, head of the Captains Endowment Association, which also represents deputy chiefs, said last week, “I’m surprised. If they did nothing wrong, as the department maintains, why were they left out?”