SAN FRANCISCO – It’s been a long time coming, but Netflix’s U.S. subscribers will now be able to automatically see what their Facebook friends have been watching on the Internet video service, as long as they are willing to open a peephole into their viewing habits, too.

The sharing tool announced Wednesday is rolling out 18 months after Netflix Inc. introduced the feature to its international subscribers.

The expansion exposes the feature to a much wider audience because Netflix has 27 million Internet video subscribers in the U.S. versus 6 million customers in more than 50 other countries and territories.

Netflix isn’t creating an outlet for the 8.2 million subscribers to its shrinking DVD-by-mail rental service to share what they’re checking out on discs.

Netflix withheld the sharing tool in the U.S. to avoid breaking a 1988 law that banned the disclosure of video rental records without a customer’s consent. After several years of lobbying, the Lost Gatos, Calif., company persuaded Congress to revise the law so subscribers could choose to activate a video-sharing feature.

President Obama signed the amended law in January, clearing the way for Netflix to offer U.S. subscribers another way to find movies and TV shows that may appeal to their tastes.

In the process, Netflix hopes to deepen subscriber loyalty and generate positive buzz about the $8-per-month service.

“This has been a missing link for us,” said Tom Willerer, Netflix’s vice president of product innovation. “Being able to see more recommendations from your friends can be a very powerful thing.”

Investors apparently believe the new feature will increase Netflix’s popularity and, by extension, its profits. Netflix shares surged by $10.25, or 5.6 percent, to close at $192.36.

The sharing tool could backfire if it raises privacy concerns as subscribers discover how much Facebook friends are finding out about their viewing preferences.

Once the sharing feature is activated, new rows labeled “Friends’ Favorites” and “Watched by your friends” will be displayed within a subscriber’s account.

On the flip side, any subscriber who has signed up for Facebook sharing will have their movie selections displayed with the accounts of their Facebook friends, unless an extra step is taken to exclude a specific movie or TV show.

What subscribers are watching won’t be posted on Facebook’s social network unless they go into their setting to permit the sharing on that website, too.