Police rescued two teenage girls from a sex trafficking ring in Brooklyn, the NYPD said Sunday morning.

The girls went missing last Tuesday, when they were driven down from Ulster County and into the Bronx, according to officials.

Police said the girls were then brought to a so-called "trap house," an apartment used to throw parties and run prostitutes.

At one point, the girls were taken to East New York, where they were held captive by two men and a woman, police said.

They allegedly planned to put the teenagers into prostitution, investigators said, but one of the girls was able to send her location to her father's phone.

The three suspects — two 19-year-olds and a 20-year-old — were arrested on attempted sex trafficking and other charges.