U.S. District Judge Loretta Preska ruled on Thursday that Microsoft Corp. should turn over copies of its customers' emails stored in an Ireland-based server to the American government.

The software giant argued before a federal court in New York that the U.S government should not pressure American tech companies to turn over emails stored in servers located outside the country. The company stated emails should have the same privacy protection as regular mail; therefore, a warrant should be issued first before using them for investigation.

The U.S. government sent Microsoft a search warrant to obtain copies of emails on an unnamed user involved in a drug case. The company refused to comply and argued that the warrant was invalid because the server is based in Ireland, but Preska ruled that the warrant is valid.

"It is a question of control, not a question of the location of that information," Preska said.

During the hearing, Microsoft's legal counsel suggested the government form a treaty between the United States and Ireland, but assistant U.S. attorney Serrin Turner defended that such actions were not legally required and are complicated and time-consuming.

"We don't need to go to a foreign country to get the records," Turner said, quoted by Bloomberg News. "The provider is right here."

Microsoft plans to bring the case to the 2nd U.S. Circuit Court of Appeals. Other companies, including AT&T, Apple, Cisco, Verizon and privacy group Electronic Frontier Foundation, expressed their support to the software giant, Reuters reported.

"The only issue that was certain this morning was that the District Court's decision would not represent the final step in this process," said Executive Vice President and General Counsel Brad Smith. "We will appeal promptly and continue to advocate that email services deserve strong privacy protection in the U.S. and around the world."