Apple has another friend in its fight against the FBI.

Google CEO Sundar Pichai has come out in support of Apple (AAPL), which is fighting an order to help the FBI break into the iPhone owned by one of the San Bernardino shooters.

While acknowledging law enforcement faces "significant challenges" to protect the public, Pichai voiced his support for Apple CEO Tim Cook in a series of tweets.

"Forcing companies to enable hacking could compromise users' privacy," Pichai said in the first of five tweets.

1/5 Important post by @tim_cook. Forcing companies to enable hacking could compromise users' privacy — sundarpichai (@sundarpichai) February 17, 2016

2/5 We know that law enforcement and intelligence agencies face significant challenges in protecting the public against crime and terrorism — sundarpichai (@sundarpichai) February 17, 2016

3/5 We build secure products to keep your information safe and we give law enforcement access to data based on valid legal orders — sundarpichai (@sundarpichai) February 17, 2016

4/5 But that's wholly different than requiring companies to enable hacking of customer devices & data. Could be a troubling precedent — sundarpichai (@sundarpichai) February 17, 2016

5/5 Looking forward to a thoughtful and open discussion on this important issue — sundarpichai (@sundarpichai) February 17, 2016

Pichai said that while Google gives "law enforcement access to data based on valid legal orders," that's different than requiring companies to hack devices.

In an earlier public letter, Cook called the government's order "an overreach." Cook warned that complying would entail building "a backdoor to the iPhone" -- "something we consider too dangerous to create."

Pichai isn't alone in his support for Apple. Ex-NSA contractor Edward Snowden, who kicked off the privacy debate, came out in defense of Apple Wednesday.

"The FBI is creating a world where citizens rely on Apple to defend their rights, rather than the other way around," Snowden tweeted.

Before Pichai commented on the issue, Snowden was critical of Google's silence.

"This is the most important tech case in a decade. Silence means @google picked a side, but it's not the public's," he tweeted.

This is the most important tech case in a decade. Silence means @google picked a side, but it's not the public's. https://t.co/mi5irJcr25 — Edward Snowden (@Snowden) February 17, 2016

- Jose Pagliery, Evan Perez and Tim Hume contributed to this report