Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Former U.S. Attorney General Eric Holder says fugitive leaker Edward Snowden performed a "public service" but still deserves to be punished.

Eric Holder speaks at the Justice Department on March 4, 2015. Carolyn Kaster / AP, file

"We can certainly argue about the way in which Snowden did what he did, but I think that he actually performed a public service by raising the debate that we engaged in and by the changes that we made," Holder told former Obama White House adviser David Axelrod on an episode of "The Axes Files" podcast released Monday.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

But the former attorney general was quick to add that Snowden — who leaked explosive documents about American government surveillance programs while working as a contractor for the National Security Agency in 2013 — acted in a way that was "inappropriate and illegal."

"I think he harmed American interests," Holder said. "I know there are ways in which certain of our agents were put at risk, relationships with other countries were harmed, our ability to keep the American people safe was compromised."

.@Snowden performed a "public service;" still most pay for crime, says Fmr AG Eric Holder. https://t.co/igHYoNb3NW… pic.twitter.com/t1OvjvFyWW — David Axelrod (@davidaxelrod) May 30, 2016

Holder called on Snowden, who has been living in exile in Moscow for the last three years, to come back to the United States to face the "consequence" of his actions.

"He's broken the law, in my view," Holder said. "He needs to get lawyers, come on back and ... see what he wants to do: Go to trial, try to cut a deal. I think there has to be a consequence for what he has done."

Holder added that a judge "could take into account the usefulness of having had that national debate" in deciding any "appropriate sentence" for Snowden.

Snowden claimed in an interview with the BBC late last year that he had "volunteered to go to prison with the (U.S.) government many times" but had not heard back from the American government.

The Department of Justice at the time would not confirm or deny that assertion.

The revelations contained in the material leaked by Snowden set off a national conversation about the give-and-take between national security and civilian privacy.

Holder served as attorney general from 2009 to 2015. He has since returned to private law practice at the firm Covington & Burling.