A jury took just three hours yesterday to acquit a veteran NYPD detective of swiping a MasterCard from an unsuspecting prisoner during a station-house search.

“I’m done,” said an elated Edguardo Rodriguez after the verdict in Queens Supreme Court. “I’m tired. It’s been going on for two years.”

Prosecutors tried to prove Rodriguez pilfered the credit card in July 2002 at the 106th Precinct as other officers were frisking a suspect.

But Rodriguez, 40, still faces charges of petit larceny and forgery on Long Island for allegedly buying a $149 phone, a $119 Sonicare toothbrush and other items with the card at stores and a perfume kiosk in Bay Shore.

Rodriguez could get up to seven years on those charges and also faces departmental penalties.

The jury foreman said the panel found the surveillance videos from the stores too grainy and was unconvinced by the testimony of the perfume kiosk clerk who identified Rodriguez.

“There was more than enough reasonable doubt to keep us from convicting,” said the foreman.

Rodriguez testified he unwittingly took the card home from the precinct in a pile of papers.

A friend at his house the next day then took the card on the illicit shopping spree, according to Rodriguez’s lawyer, Frank Kelly.