A police officer committed a shady crime in Long Island and he is now under investigation. Hit the jump to find out what happened.

Melissa Nash

THE FBI is investigating whether an NYPD detective has been moonlighting — as part of a burglary crew.

Rafael (Ray) Astacio was caught red-handed after a break-in at a Long Island home earlier this month, and authorities think he works with a team that pulled off other capers in New York City, sources told the Daily News.

The FBI is also probing whether the 14-year veteran committed any crimes or was involved in corruption during his years as a vice cop and sex-crimes investigator, law enforcement sources said.

For now, Astacio, 39, has only been charged with second-degree burglary. Freed on $2,500 on bail, he was suspended from the NYPD without pay a day after his arrest.

Reached at his home in Copiague, L.I., where a shiny black Mercedes C300 was parked in the recently redone driveway, Astacio hung up without commenting.

He was collared June 3 after he and three accomplices broke into the Lindenhurst home of diner owner Anastasios Matheos, according to court papers.

Authorities say Lindenhurst, L.I., home of Anastasios Matheos was robbed by NYPD Detective Ray Astacio.

The crew got into the home through the backdoor and were leaving with $2,500 worth of jewelry when cops from Nassau and Suffolk County and FBI agents busted them, court papers show.

Matheos, 64, arrived home from church around 9 p.m. to find cops massed outside.

“They told me there was a robbery and they got the guys,” he recalled.

He said he didn’t find out until Monday that one of the alleged thieves was sworn to serve and protect. “What a dirtbag,” he said. “In a bag of potatoes there is always one bad one,” he added, praising the officers who caught the quartet. “They did the job good. They were gentleman. I would like to thank them.”

Matheos, a Greek immigrant who has lived in the U.S. for 40 years, said the intruders didn’t ransack the place but rather went right for jewelry belonging to his wife, Lasiliki, 60, and his daughter Eleni, 27.

He said he was grateful the burglars apparently overlooked his daughter’s $10,000 engagement ring, which was just sitting out on a table in the Oxford St. house.

The suspects arrested along with Astacio were identified as Paul Adams, 46, Michael Brown, 24, and Joseph Alacqua, 31. All are free on bond.

Brown’s mother said he was partying in Atlantic City at the time of his alleged crime. Adams’ uncle said he was “not too shocked” to learn of the charges against his nephew, an unemployed electrician. Alacqua previously served 18 months on a drug possession rap.

Astacio joined the NYPD in 1995 and made more than $100,000 in 2010 in salary plus overtime. Neighbors said he has a wife and two kids and recently renovated his two-story Cape-style home.

“He keeps to himself,” his next-door neighbor said.

Astacio was named in a false-arrest suit in 2009 after Jose Gonzalez-Pena was busted on a gambling rap and then held in jail for an extra day on a warrant that was actually for someone else.

Gonzalez-Pena sued the city and the detective and won a $25,000 settlement.

“Their argument, of course, was that it was totally inadvertent,” Gonzalez-Pena’s lawyer Brian Bromberg told The News. “They should have realized on the face of the papers that there was a problem, that they had the wrong guy.”

As a special victims squad detective, Astacio was involved in several high-profile cases, including the bust of a pervert who posed as a gynecologist to molest women who answered help-wanted ads, and the arrest of a Queens man charged with abducting a passed-out woman from Marquee nightclub and raping her.

The detective is also one of the original members of the NYPD’s baseball team. His lawyer could not be reached for comment, and the head of the detectives’ union did not return calls.