The following is a script of "The War on Leaks" which aired on Oct. 12, 2014. Lesley Stahl is the correspondent. Richard Bonin, producer.

You've just heard FBI Director Comey discuss the NSA surveillance program with Scott.

This is a story about another facet of the NSA program, involving wiretaps, and what happens when the demands of national security collide with the public's right to know.

That dilemma is at the heart of the case of James Risen, a Pulitzer-Prize winning investigative reporter for the New York Times.

Risen was the first to break the story about the NSA's secret wiretapping program that monitored Americans' phone calls without a court warrant. He's been subpoenaed to divulge his confidential sources in a separate federal criminal trial. He appealed the subpoena all the way up to the Supreme Court, but the court turned down his petition. Now, if he doesn't name names, he could go to jail.

Lesley Stahl: Will you divulge your source?

James Risen: No.

Lesley Stahl: Never?

James Risen: Never, no. Basically, the choice the government's given me is: give up everything I believe or go to jail. So, I'm not going to talk.

Those who know Jim Risen say he isn't bluffing, that he's stubborn, curmudgeonly and dogged.

Lesley Stahl: Sometimes you get yourself in trouble.

James Risen: Yeah, the government's been after me for quite a while now, so.

Lesley Stahl: Well, because of what you publish, not personally, right?

James Risen: Feels personal.

He says the current standoff with the government began in 2004 over what would become the biggest story of his career that would win the Pulitzer Prize: the top-secret warrantless wiretap program run by the National Security Agency.

"It was warrantless but not unwarranted."

James Risen: It was called "No Such Agency." And it was this massive part of the intelligence community that almost no one ever wrote about. What they were supposed to do was spy on foreigners, electronic eavesdropping of foreign people overseas. Basically, what I found out about it was, they had suddenly turned this giant eavesdropping operation at the NSA onto the American people, in secret. And that's what the story was.

Lesley Stahl: Were they actually listening in or just recording that metadata?

James Risen: They were doing both. They had the content and they were getting the metadata.

After 9/11, President Bush authorized the NSA to listen in on Americans suspected of ties with al Qaeda - without a judicial warrant as required by law.

James Risen: I get these people who start telling me, in the government and elsewhere, "There's this huge secret I can't tell you about."

Lesley Stahl: Did they say they were upset about it? That it...

James Risen: Yes. They were tortured by what they knew. But they were frightened at the same time.

Over the next six months, he pieced the story together about the NSA surveillance program, then called the NSA's press office for a comment.

"I knew we were playing up against the line."

James Risen: I said, "I need to speak right now to Mike Hayden," the NSA director.

Lesley Stahl: The head of NSA. You said that?

James Risen: The head of NSA. And I said, "I can't tell you why. It's urgent. But I got to talk to him right now." And I was bluffing. But she, to my shock, she put him on the phone immediately. And so as soon as Hayden got on the phone, I read him the top of the draft of the story, the first few paragraphs. And I heard this [gasp]. And I knew I had him right there.

It's a conversation General Mike Hayden will never forget.

Lesley Stahl: So what was your first reaction when you realized that the New York Times was on to the NSA story?

Mike Hayden: Well, first reaction was this is not good news. This was a program that we relied on a great deal. It was covering al Qaeda operatives inside the United States, communicating with al Qaeda overseas and abroad.

Lesley Stahl: The FBI doesn't do that?

Mike Hayden: Well, not the way we did it.

He acknowledges the NSA program was "unarguably inconsistent" with the 1978 law prohibiting the agency from eavesdropping on Americans without first obtaining a court warrant.

Mike Hayden: It was warrantless but not unwarranted. It would've been irresponsible for NSA not to have done this in the immediate aftermath of the attacks of 9/11.

Lesley Stahl: But it was eavesdropping on Americans? That was the story.

Mike Hayden: You know, one has to choose words carefully here, all right. We were allowed to intercept international calls.

Lesley Stahl: Had to be overseas.

Mike Hayden: Had to be overseas. And we already had reason to believe that one or both ends of the call were affiliated with al Qaeda.

Besides, government lawyers assured him that the president's authority as commander-in-chief trumped the 1978 law. In their view, the program was both legal and constitutional, though he acknowledges, just barely.

Mike Hayden: Hey, I knew we were playing up against the line.

Lesley Stahl: So what you're telling us is that you went into this knowing that if it came out...

Mike Hayden: Oh God, yes.

Lesley Stahl: ...there would be questions of legality?

Mike Hayden: Of course, and appropriateness, and abuse.

"It was the best story in my life, and I wasn't going to let anybody else write it."

Lesley Stahl: That's why you didn't want it to come out? See, that's what Jim Risen says. You didn't want to be embarrassed.

Mike Hayden: Let me turn it, OK. Jim's going to go to jail. Why? Because Jim wants to protect his sources. We're both in the same business, you and me, Jim and me. You have sources who remain productive only as long as you can protect them from exposure. Exposing our tactics, techniques, procedures, sources and methods harms us as much as Mr. Risen would be harmed if he were forced in court to expose his source.

What followed was an all-out effort by the Bush White House to kill the story. Bill Keller, then executive editor of the Times, was summoned to the White House for a meeting with General Hayden and other top officials.

Lesley Stahl: Do you think that they were more worried about losing this tool to fight terrorism or that they would be embarrassed by it? Because it was spying on Americans.

Bill Keller: I think both of those things concerned them. But it was a question of, "If we publish this story, will it...," to put it bluntly, "cost lives?"

Lesley Stahl: Did they argue that, that it would cost lives?

Bill Keller: Yes. There's also a context. I mean it was not that long after 9/11. And I think all of us were affected by that.

And so he decided not to run the story. Risen was livid. It was the latest run-in with his editors, who he says had sided with the government on other stories of his involving national security.

Lesley Stahl: What kept you from walking out?

James Risen: I wanted to get that damn story in the paper. It was the best story in my life, and I wasn't going to let anybody else write it.

Lesley Stahl: General Hayden makes the argument that you didn't have the expertise or the knowledge to know the whole picture and to understand the whole picture. And I guess implicit in that argument is who the hell are you?

James Risen: Yeah.

Lesley Stahl: I'm serious. Who elected you, yeah.

James Risen: The whole global war on terror has been classified. If we today had only had information that was officially authorized from the U.S. government, we would know virtually nothing about the war on terror.

He teamed up with another reporter, Eric Lichtblau, and together they kept digging. Still, his editors were not persuaded and killed the story again, two months later, in December 2004.

James Risen: The story was dead for good. I was furious and I said to myself, "I'm going to put that in my book."

He was writing a book. And he was going to put several reports in it that his editors had killed, along with the NSA story. Jill Abramson, then the Times' second-in-command, says that was a turning point.

Jill Abramson: It would be potentially very embarrassing to the Times to have this big story come out in Jim's book. And our readers would feel why was this not in the New York Times?

Lesley Stahl: So he forced your hand? He did.

Jill Abramson: In some ways, he forced our hand. Sure he did.

Lesley Stahl: Had you fallen under the sway of the post-9/11 concerns about safety in this country, security.

Jill Abramson: I think that I had a bit, and I don't think I was alone. I think that the years right after 9/11 were a period when the Washington press corps, and I put myself very much in that group, it wasn't our finest hour. It wasn't.

By 2005, the atmosphere had changed. The Iraq war had not gone well, and when no weapons of mass destruction were found, the Bush administration's credibility suffered. That and the pressure of Risen's book led to the Times putting the story back in play. And then came a climactic meeting in the Oval Office among President Bush and General Hayden, Bill Keller and the publisher of the Times, Arthur Sulzberger, Jr.

Bill Keller: The president said, you know, "If there's another attack like 9/11, we're going to be called up before Congress to explain how we let that happen. And you should be sitting alongside us." It was, in effect, you know, "You could have blood on your hands."

Lesley Stahl: He was saying, "If anything goes wrong, we're going to blame you."

Bill Keller: Right.

Lesley Stahl: And you walk out with that on your chest.

Bill Keller: Yeah.

Despite that, the Times went to press, running the story on December 16, 2005, more than a year after Risen had first offered it. And it was explosive, triggering congressional hearings and an FBI investigation into who Risen's sources were.

The administration also reached out to Leslie Moonves, head of CBS, whose Simon & Schuster division was the publisher of Risen's book, in an unsuccessful attempt to stop its publication.

After more than two years, the FBI stopped pursuing the leak investigation into Risen's NSA story.

James Risen: The Bush administration I think decided they didn't want a constitutional showdown with the New York Times over a story like the NSA story. And so I think they decided to drop that investigation and then come after me on my book.

They came after him about this chapter, detailing a botched CIA operation called "Merlin," involving Iran's nuclear weapons program.

Lesley Stahl: Well, it was classified information.

James Risen: It was classified information, but I believed that the government was trying to cover up an embarrassment and it was not for national security reasons.

Risen was subpoenaed in 2008 to divulge his sources on Merlin. But when President Obama was elected, he thought it would all be over.

James Risen: Now everything's going to be fine.

Lesley Stahl: He had talked about transparency and protecting whistleblowers in the campaign.

James Risen: Yes. And I was shocked. They said, "No, no, no. We want to keep this going." And they subpoenaed me again.

What shocks him even more is that the Obama administration has prosecuted more government leakers than all previous presidents combined and his Justice Department has seized the records of phone calls made by more than a hundred AP reporters and investigated a Fox News correspondent under the Espionage Act.

"Frankly, Lesley, I don't understand the necessity to pursue Jim."

James Risen: In my case, it's come out that they got my travel records, my credit reports, my credit card data, my phone records.

Lesley Stahl: From a court warrant?

James Risen: No.

Lesley Stahl: From what?

James Risen: It's secret. They won't say how they got it.

Lesley Stahl: So do you think that Jim Risen should be compelled to divulge his sources?

Mike Hayden: I am, like America, conflicted. OK?

Lesley Stahl: Really?

Mike Hayden: I am. I am. You're talking about ruining lives over things about which people are acting on principle, so I'd be very careful about it.

Lesley Stahl: So you would not be pursuing Jim if you had the decision to make?

Mike Hayden: Frankly, Lesley, I don't understand the necessity to pursue Jim.

Lesley Stahl: You're shocking me that the former head of the NSA is saying that it's coming down too hard.

Mike Hayden: I'm conflicted. I know the damage that is done. And I do. But I also know the free press necessity in a free society. And it actually might be that I think, "No, he's wrong. That was a mistake. That was a terrible thing to do. America will suffer because of that story." But then I have to think about, so how do I redress that? And if the method of redressing that actually harms the broad freedom of the press, that's still wrong. The government needs to be strong enough to keep me safe, but I don't want it so strong that it threatens my liberties.

That's the crux of the dilemma. For his part, Risen argues that what he revealed was not a government secret, as much as a program he thought was illegal.

James Risen: We weren't revealing to anybody the fact that the United States listened to terrorist phone calls. Everybody knew that. The terrorists have known that forever. What we were revealing was that the U.S. government was violating its own laws.

Lesley Stahl: Did you think that the whole program, did you think it was useless?

James Risen: No, I didn't think it was useless. I thought that if we are going to fight a global war on terror, we should follow the rule of law in the United States.

Risen remains at the New York Times, still covering national security. And he's written a new book. He could be called to testify about his confidential sources as early as January.