CHAPEL HILL, NORTH CAROLINA — State investigators and college police used a controversial tracking technology called "geofencing" to collect personal information from the cellphones of antiracism protestors at the University of North Carolina after being tipped off by the FBI, according to documents obtained by NBC News via a freedom of information request.

The documents also show that the university signed a three-year, $73,500 contract for the use of geofencing in 2016, a contract that ran through the end of October 2019.

"Geofencing" captures the social media posts of people entering a specific area. The technology locates any cellphones that cross into the area by locking onto their geolocation systems, and then records social media posts and sometimes other data from the phones.

Versions of geofencing have been used in politics, including by the Trump reelection campaign and the Texas Democratic Party, and by retailers, who send ads touting sales and products to any nearby cellphones.

At UNC, however, internal university emails obtained by NBC News show that officials used the technology at least once to monitor activists who showed up for a protest at a campus Confederate memorial known as "Silent Sam" — a statue of a gun-wielding rebel soldier.

On Saturday, Aug. 12, 2017, white supremacists met in Charlottesville, Virginia, for a planned march to protest the proposed removal of a Robert E. Lee statue from a city park. A white supremacist drove his car into a counter-protestor, killing her.

The incident raised concerns among law enforcement officers in other cities, including Chapel Hill, about potential violence at other protests.

A Silent Sam supporter shouts at counter-demonstrators from behind a barricade, while pointing to the pedestal where the statue once stood. Arijit Sen / NBC News

At just before 1 p.m. the next day, Sunday, Aug. 13, 2017, an FBI agent sent the chief of the UNC campus police an email that said, "I'm sure you're already tracking, but wanted to make sure," and mentioned that anti-racist protestors were expected to gather at Silent Sam at 7 p.m. for a "Charlottesville Solidarity Action."

"We have no information of any planned violence at this time," said the FBI agent. "Any intelligence we develop will be pushed your way."

The Silent Sam statue was already the site of regular protests. That afternoon at 3:12 p.m., when a small group of people had gathered at the statue, UNC police intelligence chief Jake Kornegay sent an email to the UNC police chief and three other members of the department.

"Geo-fence is being monitored and real-time distribution list established with Orange County LE and ISAAC/JTTF," wrote Kornegay, referencing law enforcement from the surrounding county, the State Bureau of Investigation's Information Sharing and Analysis Center and the local Joint Terrorism Task Force, which combines local and federal law enforcement. He also said he was doing "some link analysis on social media" and that only "a few people" were at the statue.

That evening, during the Charlottesville Solidarity Action, the crowd at the statue had grown to 175 to 200 people, according to minutes of a meeting held five days later by a university group referred to as the High Interest Events Team. "Aggressive in demeanor and approach," said the minutes. "Event was surveilled."

There is no evidence in the materials obtained by NBC News to show whether geofencing was used at protests prior to or after Aug. 13.

But according to contract information obtained via the freedom of information request, the university had begun began paying a Vermont-based company called Social Sentinel Inc. $73,500 nearly a year earlier to use software that allowed them to pull social media posts from a geographic area. The purchase order from the company says the data Social Sentinel provided to the school was given to them by "one or more social media services or third party data providers."

An officer leads a detained protester to a van, while other officers guard them on Aug. 25, 2018. Arijit Sen / NBC News

The documents show the contract extended from Nov. 1, 2016 through Oct. 31, 2019.

A university spokesperson confirmed that the campus police continue to use geofencing, but would not say for what.

The spokesperson declined to comment on how the technology has been used, or when it was used, saying that, "The university coordinates with and relies on assistance from state and federal law enforcement agencies when appropriate in order to ensure campus safety."

UNC police, Kornegay and Carol Folt, who was university chancellor in 2017, did not respond to requests for comment.

A spokesperson for North Carolina's State Bureau of Investigation defended the practice, saying the agency only monitored "publicly available posts … within a certain geographic area" but declined to specify exactly what information was obtained.

"This information was monitored in an attempt to prevent any potential acts of violence (such as those that have occurred at other public protests around the country, including Charlottesville) and to ensure the safety of all participants," said Anjanette Grube, the SBI spokesperson, in a statement. "No records of the posts are kept after the event has concluded."

Grube said the geofence was "not used to monitor any particular individuals."

In her statement, Grube said SBI has also used geofencing to assist local law enforcement agents "at other mass gatherings" in North Carolina like sporting events to prevent violence. She did not say whether geofencing had been used again at Silent Sam protests.

Gary Margolis, Social Sentinel's chief executive, declined to discuss how UNC used his product -- or to confirm that UNC was a client. He did say, however, that his company has "been very clear on the record that we don't monitor, we don't surveil, we don't follow, nor will we be part of that kind of activity. Our system technologically isn't built to do that."

Margolis also said that geofencing is "kind of old technology" and that these days "most of social media ... is not geotagged."

Anti-statue activist Maya Little, a Ph.D. student and teaching assistant at UNC, a frequent protestor at the statue site, was "shocked but not surprised" when shown evidence of the use of geofencing.

"I feel sorry for students though, because they're paying for this kind of experience -- to be traumatized and to be surveilled," Little said.

After Aug. 13, 2017, regular protests continued at the Silent Sam statute. In August 2018, a large crowd of protestors tore it down. Protestors still gather regularly at the site where the statue once stood.

A protestor zip-ties two bamboo poles together to obscure Silent Sam, a confederate monumnet on UNC-Chapel Hill's upper quad. Arijit Sen / NBC News

In November, the UNC System's Board of Governors voted to give the statue to the North Carolina Sons of Confederate Veterans, along with $2.5 million for its care and preservation, leading to widespread outrage among students and faculty.

No warrants

Geofences, or virtual perimeters, are often used by companies to deliver location-based ads for goods and services. But they have also been used by the Department of Homeland Security and the National Security Agency as a form of cell phone monitoring, according to agency and whistleblower reports.

Geofences have also been used by local law enforcement agencies in recent years, including in cases against defendants in Virginia, Kentucky, Oregon and Alabama. In those cases, the technology was deployed to capture identities near a crime scene to identify potential suspects, witnesses and victims or collect evidence.

NBC News was unable to identify any other colleges that have used geofencing to monitor protestors.

Eight legal experts contacted by NBC News said using geofencing on protestors, especially in the absence of a crime, may violate federal statutes and infringe on demonstrators' First and Fourth Amendment rights.

Aziz Huq, a professor of criminal procedure at the University of Chicago Law School and a graduate of UNC, said the technology could lead to police abusing their power.

"If governments are allowed to open-endedly collect information and then examine the information and find evidence of what it thinks is a crime creates an incentive at the front end for government to over acquire information through these warrants," Huq said. "More colloquially it creates an incentive for government to engage in phishing expedition."

In October, lawyers for Okello Chatrie, an accused bank robber in Virginia, filed a document attempting to suppress evidence officers obtained via a geofence warrant served on Google, calling it "unlawful and unconstitutional."

Ari Ezra-Waldman, a Constitutional and privacy law professor at New York Law School, said the use of the technology was "fascinating and horrifying" when sent a copy of Kornegay's Aug. 13, 2017 email by NBC News. He likened geofencing to facial recognition technology, which is being used by governments and police across the world.

"Although this technology isn't using AI to identify faces, the distinction still holds for geofencing: applied to a specific alleged criminal versus a lawful population in the name of 'law and order' or whatever," Waldman said. "The former could be seen as souped-up police work; the latter is a dystopian policy state."

In several recent court cases, defendants have challenged the law enforcement's warrantless use of geofence technology, though many have been unsuccessful. In 2016, the Fifth Circuit Court of Appeals affirmed a lower court ruling which allowed geo-fence evidence to be used in court.

UNC police did not answer when asked if they had obtained a warrant to geofence the area. Scott Holmes, a law professor at North Carolina Central University and attorney for many who were later arrested at protests around the statue, said he had seen no such warrants provided to him by the District Attorney and hadn't heard of the geofence until contacted by NBC News. SBI did not respond to follow-up questions about whether the agency obtained a warrant for the use of the technology.