Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Facebook will pull a controversial market research program from Apple’s operating system after a report revealed that it likely ran afoul of Apple's data collection policies, Facebook sources told NBC News early Wednesday.

TechCrunch reported Tuesday afternoon that Facebook had been paying users up to $20 per month to install a "Facebook Research" app that gave the company the ability to monitor their phone and web activity.

The app, in place since 2016, was similar to Facebook’s Onavo Protect app, which Apple banned last June after determining that it violated its policies.

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

Facebook sources said the company would end the program with Apple "immediately," pre-empting likely action by Apple later Wednesday.

Yet even as Facebook pulled the program, it stood by what it described as a perfectly legitimate market research tool.

"Despite early reports, there was nothing 'secret' about this; it was literally called the Facebook Research App,” a spokesperson said in a statement. “It wasn't 'spying' as all of the people who signed up to participate went through a clear on-boarding process asking for their permission and were paid to participate."

Facebook also took issue with the report’s characterization that the program targeted teens. Facebook sources confirmed the program targeted users between the ages of 13 and 35.

"Less than 5 percent of the people who chose to participate in this market research program were teens,” the spokesperson said. “All of them with signed parental consent forms.”

The tech giant’s latest misstep came as Apple was wrestling with its own headaches after reports surfaced that it had been slow to act on a FaceTime bug that allowed spying on iPhones.

Meanwhile, Facebook has hired three of its critics in the tech industry to its privacy policy team in Washington, D.C, as part of an effort to bring fresh eyes to its struggles with privacy issues.