Google has been ordered by a US court to cough up people's private Gmail messages stored overseas – because if that information can be viewed stateside, it is subject to American search warrants, apparently.

During a hearing on Wednesday in California, magistrate judge Laurel Beeler rejected [PDF] the advertising giant's objections to a US government search warrant seeking data stored on its foreign servers. The Mountain View goliath had filed a motion to quash the warrant, and was denied.

The warrant, issued on June 30, 2016, ordered Google to hand over information on a number of specific Gmail accounts, including message content, attachments, metadata, and locational data.

While Google complied with the warrants and handed all of the requested records for several accounts over to Uncle Sam's agents, it refused to cough up information on two accounts and declined to access attachments on two others, arguing that because the data was held outside the US it was not covered by the warrant, as was decided in the Microsoft email brouhaha.

Judge Beeler, however, disagreed with the Chocolate Factory's assessment, reasoning that if Google was able to pull up the data on its own machines in the US, then it should fall under a US court's jurisdiction and, because it would be pulled from Google's HQ in Mountain View, it was not considered overseas content the way Microsoft's Ireland-based info was.

"The service provider – Google – is in the district and is subject to the court's jurisdiction; the warrant is directed to it in the only place where it can access and deliver the information that the government seeks," Beeler wrote.

"Unlike Microsoft, where storage of information was tethered to a user's reported location, there is no storage decision here. The process of distributing information is automatic, via an algorithm, and in aid of network efficiency."

Google has now been ordered to produce all of the Gmail account and message information the government requested in the warrant. The biz declined to comment. ®