Apple will attempt to frustrate tools used by Facebook to automatically track web users, within the next version of its iOS and Mac operating systems.
"We're shutting that down," declared Apple's software chief Craig Federighi, at the firm's developers conference.
He added that the web browser Safari would ask owners' permission before allowing the social network to monitor their activity.
The move is likely to add to tensions between the two companies.
Apple's chief executive Tim Cook had previously described Facebook's practices as being an "invasion of privacy" - an opinion Facebook's founder Mark Zuckerberg subsequently denounced as being "glib".
At the WWDC conference - where Apple outlines its software plans for the months ahead - Mr Federighi said that Facebook keeps watch over people in ways they might not be aware of.
"We've all seen these - these like buttons, and share buttons and these comment fields.
"Well it turns out these can be used to track you, whether you click on them or not."
"You can decide to keep your information private."
One cyber-security expert applauded the move.
"Apple is making changes to the core of how the browser works - surprisingly strong changes that should enable greater privacy," said Kevin Beaumont.
"Quite often the changes companies make around privacy are small, incremental, they don't shake the market up much.
"Here Apple is allowing users to see when tracking is enabled on a website - actually being able to visually see that with a prompt is breaking new ground."
He added that the firm appeared willing to flash up a lot of prompts despite the potential for this to become annoying.
"Perhaps Apple is gambling on websites reining in tracking rather than users having to give constant permission to track their device," he added.
Apple also said that MacOS Mojave would combat a technique called "fingerprinting", in which advertisers try to track users who delete their cookies.
The method involves identifying computers by the fonts and plug-ins installed among other configuration details.
To counter this, Apple will present web pages with less detail about the computer.
"As a result your Mac will look more like everyone else's Mac, and it will be dramatically more difficult for data companies to uniquely identify your device," Mr Federighi explained.
Key takeaway from WWDC today. Apple really dislikes the free service with advertising business model.— Ben Bajarin (@BenBajarin) June 4, 2018
By Dave Lee, North America technology reporter
Apple's attempts to block data tracking as you travel around the web could have a real impact on companies that rely on your personal information to make their billions.
And of course, where Apple goes, others often follow. So, if this keynote sets a trend, Facebook might have reason to worry.
Each demo showing these new tools used Facebook and Instagram - owned by Facebook - as the example of something you would want to block or at least restrict.
The question now is whether Facebook and other ad-tech companies will try to find new ways to trail our web activity, in an attempt to outsmart Apple.
Apple also overhauled its virtual assistant Siri to control third-party apps without users having to open them.
A new Shortcuts function allows device owners to assign their own phrases to different commands.
In addition, a single command, such as "I'm heading home" can be set to trigger multiple actions.
Although Apple was one of the first tech firms to offer a smart assistant, Siri is widely seen to have fallen behind its rivals in recent years.
Its new abilities appear to be an attempt to expand its capabilities without requiring the kind of personal data-sharing that Android requires to get the best out of Google Assistant.
"Voice assistants like Siri are critical because they are becoming a vehicle to a service," commented Ben Stanton, an analyst at the consultancy Canalys.
"If you think about booking taxis, ordering food or using social media, voice ultimately has the potential to overthrow today's app stores.
"That's a huge opportunity and why there's so much money being invested into voice assistants."
Siri's new functionality appears to build on Workflow, an automation tool that Apple acquired last year.
Another major addition announced for iOS 12 was Time Limit, which will allow users to pre-determine how much time they should spend using individual apps, and bring up a full-screen alert when an allowance is used up.
Although adults will be able to extend the period, they can also prevent their children from being able to do so.
Apple's new parental monitoring tools look great and I can't wait to start constantly fighting with my kids about them.— Brad Stone (@BradStone) June 4, 2018
Parents will also be able to get a breakdown of how long children are spending using different apps, block access at certain times of the day, and restrict the types of content youngsters have access to.
"Just as people know they eat too much junk food but keep on doing it, they also know they shouldn't spend hours buried in their phone but still do it," commented Neil Mawston from tech advisory firm Strategy Analytics.
"So, device-makers and app providers do have a responsibility to make sure their products don't become an addiction for consumers."
Google unveiled similar tools at its own IO developers conference last month.
Other announcements about iOS 12 included:
- Memojis, animated emojis that can be set to look like device owners, much like the AR emojis introduced on Samsung's Galaxy S9
- Group Facetime, in which up to 32 people can take part in the same audio or video call
- Shared experiences in augmented reality, whereby several devices can be used simultaneously to show graphics mixed with the real world from different points of view
The next version of WatchOS - which powers the firm's smartwatch - will also gain new facilities.
They include the ability to automatically detect when a workout has begun, so that if the user presses start several minutes later they can still be credited with all their activity.
The firm also promised to launch Walkie-Talkie - a push-to-talk Watch app, that will let two users chat together via 4G or wi-fi.
It was first announced in September 2014, but had appeared to have been forgotten until now.
Apple TV also promised a feature previously teased: Dolby Atmos, which will allow compatible audio equipment to deliver improved surround sound by bouncing audio off the ceiling.
And the next version of the Mac operating system introduces a new dark mode for people who like the colour black.
"Some of us are going to want to run dark mode just because it is so cool, I mean your emoji look great," said Mr Federighi.
Prediction: 43 designers are already writing articles about how revolutionary Dark Mode is.— Eli Schiff (@eli_schiff) June 4, 2018
(When in reality it adds unnecessary complexity and only needs to exist because all Apple UIs are blindingly white.)