Shares of online dating company Match plunged 22 percent on the news. Its parent company IAC dropped almost 18 percent.

The opt-in feature will match users specifically with people they aren't already friends with. Facebook users can build a dating profile — which friends won't be able to see.

"This is going to be for building real, long-term relationships — not just hook-ups," Zuckerberg said.

Facebook is launching a dating feature, CEO Mark Zuckerberg announced during the keynote address at Facebook 's annual F8 developer conference Tuesday.

Facebook CEO Mark Zuckerberg speaks during the F8 Facebook Developers conference on May 1, 2018 in San Jose, California.

The dating feature is likely to be a free service, challenging services such as Match-owned Tinder, which has been rolling out premium, paid features, according to Jefferies analyst Brent Thill.

"It's the first real meaningful competitor," Thill told CNBC's "Power Lunch" following the announcement. "This is a blow to the story [for Match] in the short term."

IAC chief executive Joey Levin said Facebook's product "could be great for US/Russia relationships" but hinted the space had already been cornered.

"Come on in. The water's warm," Levin said in a statement.

Match CEO Mandy Ginsberg echoed the confidence, saying the company was "flattered" Facebook was entering the space.

"We're surprised at the timing given the amount of personal and sensitive data that comes with this territory," Ginsberg said in a statement. "Regardless, we're going to continue to delight our users through product innovation and relentless focus on relationship success. We understand this category better than anyone."

The F8 conference, often an opportunity to announce new developer tools or hardware, comes amid a broader discussion of policy and privacy for the company.

Facebook for months has been dealing with the fallout of the Cambridge Analytica data leak and questions of user privacy — a firestorm set off by reports that an app developer mishandled sensitive user information.

But Zuckerberg said during his address that the company will "keep building, even while we focus on keeping people safe."

The new dating feature links to events and groups on the larger platform, allowing users with dating profiles to connect via shared interests or commonly attended events.

"It mirrors the way people actually date, which is usually at events and institutions that they're connected to," chief product officer Chris Cox said during the F8 conference.

Users can launch text-only private messages, separate from Facebook Messenger or WhatsApp.