If you're wondering who's leading the charge in the fight for civil liberties in the digital age, look no further than Maine.

The Pine Tree State enacted a law on Tuesday that requires cops and law-enforcement agencies to get a warrant any time they want to track a user's cellphone location in real-time, or get its historical location data. Maine's law is just the second in the nation, joining a similar bill passed by Montana in late June.

SEE ALSO: ACLU: Tracking Your Cellphone Location Should Require a Warrant

The law, LD 415, requires authorities to go to a judge and get a warrant both for real time cellphone tracking of a suspect's movement, as well as to access data on his or her historical location. And, as reported by Slate, the bill also requires authorities to notify the target of the surveillance within three days, unless they can justify the need for secrecy.

"A government entity may not obtain location information without a valid warrant issued by a duly authorized judge or justice," reads the law.

UPDATE, 2.30 p.m.: Maine's law only applies to local law enforcement agencies. In fact, the law specifically defines "government entity" as "a state or local agency." What's more, "under the Stored Communications Act, a state law enforcement agency can’t rely on the federal standard if the state’s law is more protective, but that a federal agency can always rely on the federal standard," as ACLU's staff attorney Nathan Wessler told Mashable.

Digital privacy advocates such as the American Civil Liberties Union (ACLU) have long argued that cellphone users have an expectation of privacy regarding their location, including their historical data.

"Because [...] people have just as strong a privacy interest in where they have been in the past as they do in where they will go in the future, law enforcement agents should also have to obtain a warrant based upon probable cause to access historical mobile phone location data," said the ACLU's Catherine Crump, in a statement (.PDF) prepared for a House hearing on geolocation privacy.

There is no federal law that prohibits warrantless tracking, and the issue has not yet reached the Supreme Court. But the Department of Justice has argued that there is no need for a warrant for historical location data since it falls under the so-called "third party doctrine." According to this legal theory, all data that a consumer willingly shares with a third party, such as his or her cellphone provider, is not protected by the 4th Amendment — a position with which privacy advocates disagree.

"When it comes to cellphone location information, no person has voluntarily turned that information over to their cellphone provider," Wessler told Mashable at the beginning of July.

In 2011, the Supreme Court ruled that affixing a GPS tracker on a suspect's car constitutes a search according to the 4th Amendment. The ACLU is arguing that that ruling should be be applied to a criminal case involving the tracking of cellphone historical location data.

Such laws seem to set a precedent for the rest of the country, though it remains to be seen if Montana and Maine are the first states to usher in a wave of privacy-conscious laws, or if they remain outliers in the battle over digital privacy.

UPDATE, 3.30 p.m.: the updated paragraph on the application of Maine's law to federal authorities has been amended to clarify that federal law-enforcement agencies aren't bound by state laws.

Image courtesy of Flickr, VinCross