The move, which hasn't been publicly announced, was confirmed by a senior U.S. intelligence official and other people familiar with the matter. The service -- which sends out alerts of unfolding terror attacks, political unrest and other potentially important events -- isn't directly provided by Twitter, but instead by Dataminr Inc., a private company that mines public Twitter feeds for clients.
Twitter owns about a 5% stake in Dataminr, the only company it authorizes both to access its entire real-time stream of public tweets and sell it to clients.
Dataminr executives recently told intelligence agencies that Twitter didn't want the company to continue providing the service to them, according to a person familiar with the matter. The senior intelligence official said Twitter appeared to be worried about the "optics" of seeming too close to American intelligence services.
Twitter said it has a long-standing policy barring third parties, including Dataminr, from selling its data to a government agency for surveillance purposes. The company wouldn't comment on how Dataminr -- a close business partner -- was able to provide its service to the government for two years, or why that arrangement came to an end.
The move doesn't affect Dataminr's service to financial industry, news media or other clients outside the intelligence community. The Wall Street Journal is involved in a trial of Dataminr's news product.
Dataminr's software detects patterns in hundreds of millions of daily tweets, traffic data, news wires and other sources. It matches the data with market information and geographic data, among other things, to determine what information is credible or potentially actionable.
For instance, Dataminr gave the U.S. intelligence community an alert about the Paris terror attacks shortly after they began to unfold last November. That type of information makes it "an extremely valuable tool" to detect events in real time, the intelligence official said.
In March, the company says it first notified clients about the Brussels attacks 10 minutes ahead of news media, and has provided alerts on ISIS attacks on the Libya oil sector, the Brazilian political crisis, and other sudden upheaval in the world.
U.S. government agencies that used the Dataminr service are unhappy about the decision and are hoping the companies will reconsider, according to the intelligence official.
"If Twitter continues to sell this [data] to the private sector, but denies the government, that's hypocritical," said John C. Inglis, a former deputy director of the National Security Agency who left in 2014. "I think it's a bad sign of a lack of appropriate cooperation between a private-sector organization and the government."
Analysis of Twitter and other social-media services has become increasingly important to intelligence and law-enforcement agencies tracking terror groups. Islamic State posts everything from battlefield positions to propaganda and threats over Twitter. San Francisco-based Twitter deletes thousands of accounts a month for violating its antiterror policies, but Islamic State supporters create new accounts almost as quickly.
"The volume of the group's activity on Twitter yields a vast amount of data that is a crucial tool for counterterrorism practitioners working to manage threats," said Michael S. Smith II, chief operating officer of the security consulting firm Kronos Advisory. "Twitter's decision could have grave consequences."
In a speech last September, David S. Cohen, a deputy director of the Central Intelligence Agency, discussed the importance of "open source" social-media data gathered by the CIA, saying Islamic State's "tweets and other social-media messages publicizing their activities often produce information that, especially in the aggregate, provides real intelligence value."
Silicon Valley and the U.S. government have been locked in intensifying conflicts over cooperation since the revelations by former National Security contractor Edward Snowden about government surveillance of electronic communication.
Most recently, Apple Inc. and the Justice Department were embroiled in a legal showdown over demands by the Federal Bureau of Investigation to unlock an iPhone used by one of the killers in the San Bernardino, Calif., attack in December. That fight -- which unlike the Dataminr product involved the release of private data -- ended in March when the FBI found another way to access the phone.
In-Q-Tel, a venture-capital arm of the U.S. intelligence community, has been investing in data-mining companies to beef up the government's ability to sort through massive amounts of information. In-Q-Tel, for example, has invested in data-mining firms Palantir Technologies Inc. and Recorded Future Inc.
U.S. intelligence agencies gained access to Dataminr's service after an In-Q-Tel investment in the firm, according to a person familiar with the matter.
When a pilot program arranged by In-Q-Tel ended recently, Twitter told Dataminr it didn't want to continue the relationship with intelligence agencies, this person said.
"Post-Snowden, American-based information technology companies don't want to be seen as an arm of the U.S. intelligence community," said Peter Swire, a Georgia Institute of Technology law professor and expert on data privacy.
Dataminr, based in New York, was launched seven years ago by three former Yale University roommates. A financing round early last year valued it at $700 million, according to Dow Jones VentureSource.
Its product goes beyond what a typical Twitter user could find in the jumble of daily tweets, employing sophisticated algorithms and geolocation tools to unearth relevant patterns.
Dataminr has a separate, $255,000 contract to provide its breaking news-alert service to the Department of Homeland Security, which is still in force.
Yoree Koh contributed to this article.