Editor's note: The following excerpt details how former CIA official David Cohen began running intelligence for the New York Police Department.

[CIA Director George] Tenet sent Cohen packing for New York, a plum pre-retirement assignment that made him the CIA’s primary liaison with Wall Street titans and captains of industry. After three decades in Washington, he had become one of the most unpopular and divisive figures in modern CIA history.

He left feeling that the agency was hamstrung by the people overseeing it. The White House micromanaged operations, slowing down everything. And Congress used its oversight authority to score political points. The CIA was stuck in the middle, an impossible position.

Now [Police Commissioner Ray] Kelly was offering a chance to start something new in the New York Police Department, without any of the bureaucratic hand-wringing or political meddling. The World Trade Center attacks had changed the world. Cohen was being given an opportunity to change policing in response. He didn’t need a couple days to think about it. He called Kelly back two hours later and took the job. [Mayor] Bloomberg and Kelly introduced Cohen as the deputy commissioner for intelligence at a city hall press conference on January 24, 2002.

Cohen spoke for just two minutes, mostly to praise the NYPD. He had been raised in Boston’s Mattapan neighborhood, and though he’d been gone for decades, he still spoke with a heavy accent.

“We need to understand what these threats are, what form they take, where they’re coming from, and who’s responsible,” Cohen said.

The new deputy commissioner offered no specifics about what he had planned. Weeks before his sixtieth birthday, he even declined to give his age, telling reporters only that he was between twenty-eight and seventy. The brief remarks from behind the lectern would amount to one of Cohen’s longest media appearances ever.

“I look forward to just getting on with the job,” he said.

Cohen’s appointment was not front-page news. The New York Times put the story on page B3. The Daily News ran a 165-word brief on page 34. It was four months after 9/11, and the country was focused on doing whatever it took to prevent another attack. Nobody questioned the wisdom of taking someone trained to break the laws of foreign nations and putting him in a department responsible for upholding the rule of law. Nobody even checked out Cohen’s hand-prepared résumé, which said he had a master’s degree in international relations from Boston University. The misstatement itself was inconsequential. That it went entirely unquestioned was indicative of the lack of media scrutiny Cohen could expect in his new job.

It didn’t take him long to realize that he was not walking back into the CIA. The NYPD had an intelligence division, but in name only. Working primarily out of the waterfront offices of the old Brooklyn Army Terminal, across the Hudson River, facing New Jersey, the detectives focused on drugs and gangs. They were in no way prepared to detect and disrupt a terrorist plot before it could be carried out. Mostly, they were known as the glorified chauffeurs who drove visiting dignitaries around the city.

Cohen knew that more was possible.

Force of will alone, however, would not transform a moribund division into something capable of stopping a terrorist attack. If Cohen wanted to remake the NYPD into a real intelligence service, there were four men—four graying hippies—standing in his way.

* * *

Martin Stolar first began hearing stories about the NYPD Intelligence Division in 1970 while working as a young lawyer for the New York Law Commune. A recently formed law firm for leftists, hippies, radicals, and activists, the commune operated entirely by consensus. It didn’t take a case unless everyone agreed. They saw themselves as part of the New Left, lawyers who didn’t merely represent their clients but who fully embraced their politics and were part of their struggle. They represented Columbia University students who’d taken over campus buildings during a protest in 1968. They stood beside members of the Weather Underground, the Black Panthers, and other radical groups, and activists such as Abbie Hoffman. And they never, ever, represented landlords in disputes with tenants.

It was a new way of thinking about the law. The firm pooled all its fees and then paid one another based on need, not ability or performance. Operating out of a converted loft in Greenwich Village, the lawyers paid the bills thanks to well-to-do parents who hired them to keep their sons out of Vietnam. But about half their time was dedicated to political, nonpaying clients.

Every now and again, one of the lawyers would come across something—a news clipping, a document, or a strong hunch—that suggested the NYPD was infiltrating activist groups and building dossiers on protesters. When they did, they’d add it to a plain manila folder, as something to revisit.

Stolar had no problem questioning government authority. In 1969 he applied for admission to the bar in Ohio, where he was an antipoverty volunteer. When asked if he’d ever been “a member of any organization which advocates the overthrow of the government of the United States by force,” Stolar refused to answer. Nor would he answer when asked to list every club or organization he’d ever joined.

The questions were holdovers from the Red Scare days of the 1950s. Stolar, a liberal New York lawyer, would have none of it. He took his case to the United States Supreme Court, which, in 1971, declared such questions unconstitutional. “[W]e can see no legitimate state interest which is served by a question which sweeps so broadly into areas of belief and association protected against government invasion,” Justice Hugo Black wrote.

Stolar had moved back to New York by then and never bothered to return to Ohio to take the bar exam. He’d proven his point. Kathleen Cleaver tells a San Francisco news conference August 24, 1972, she believes the CIA was behind threats to assassinate her Black Panther husband. AP Photo

In 1971 he was among the many lawyers working on the Panther 21 case, the trial of Black Panther Party members accused of conspiring to bomb police stations, businesses, and public buildings. While preparing their defense, the Law Commune attorneys came across something unusual: The case against the Panthers was built largely on the testimony of some of the earliest members of the New York chapter of the Black Panthers. There was Gene Roberts, a former security guard for Malcolm X who was present on February 21, 1965, when the Nation of Islam leader was assassinated in Manhattan’s Audubon Ballroom. There was Ralph White, the head of the Panther unit in the Bronx who’d once represented the entire New York chapter at a black power conference in Philadelphia. And there was Carlos Ashwood, who’d sold Panther literature in Harlem.

They were founding fathers of the New York Panthers. And all three, it turned out, were undercover detectives. The NYPD had essentially set up the New York chapter of the Black Panther Party and built files on everyone who signed up.

That convinced Stolar that something had to be done with his manila folder. He called another young lawyer, Jethro Eisenstein, who taught at New York University. The two knew each other from their work with the liberal National Lawyers Guild, and Stolar regarded Eisenstein as a brilliant legal writer. If they were going to have a shot at challenging the NYPD, the lawsuit had to sing.

Together they put out the word to their clients and friends that they were looking for stories about the NYPD. The anecdotes came pouring in, both from activists and from other lawyers who, it turned out, had been keeping folders of their own. The mass of materials described a police department run amok. There was evidence that police were collecting the names of people who attended events for liberal causes. Detectives posed as journalists and photographed war protesters. Police infiltrated organizations that they considered suspect and maintained rosters of those who attended meetings.

* * *

On May 13, 1971, the Panthers were acquitted of all charges. At the time, it was the longest criminal trial in New York history, spanning eight months. Closing arguments alone had stretched over three weeks. But the jury was out only three hours before voting for acquittal. And the first hour was for lunch.

In the courthouse lobby, jurors milled about, congratulating the Panthers and their lawyers. Some exchanged hugs. Jurors said there wasn’t enough evidence that the conspiracy was anything more than radical talk. Defense lawyer Gerald Lefcourt called the verdict “a rejection of secret government all the way from J. Edgar Hoover down to the secret police of New York City.”

The New York Times editorial page read:

It is not necessary to have any sympathy whatever with Panther philosophy or Panther methods to find some reassurance in the fact that—at a time when the government so often confuses invective with insurrection—a New York jury was willing to insist on evidence of wrong-doing rather than wrong-thinking.

Five days after the verdict, Stolar and Eisenstein filed a twenty-one-page federal lawsuit against the NYPD. It accused the department of widespread constitutional violations.

The plaintiffs represented a grab bag of the New Left. There were Black Panthers, members of the War Resisters League, and gay-rights advocates. There were well-known figures such as Abbie Hoffman and obscure groups like the Computer People for Peace. One young man, Stephen Rohde, sued because when he applied for admission to the New York bar, he’d been asked whether he’d ever opposed the Vietnam War. He had once signed a petition in a basement at Columbia University, and his views had ended up in a police file. The lawsuit became known as the Handschu case, after lawyer and activist Barbara Handschu, who was listed first among the plaintiffs. Stolar and Eisenstein argued that the NYPD was using its surveillance tactics to squelch free speech. Police Commissioner Patrick Murphy did not deny using those tactics.

Rather, he said, they were necessary to protect the city. Murphy devoted eighteen pages to explaining to the court why the NYPD needed an effective intelligence division. He said the effort began in the early 1900s as a response to the Black Hand Society, an extortion racket run by new Sicilian immigrants. As the threat evolved over the decades, so did the unit. The 1960s, Murphy said, was a dangerous time to be in New York. Along with antiwar protests, student unrest, and racial conflicts, he cited a list of terrorist bombings and what he called “urban guerrilla warfare.”

In response to that threat, Murphy explained, the NYPD stepped up its investigations of political groups that “because of their conduct or rhetoric may pose a threat to life, property, or governmental administration.” It was true, Murphy conceded, that a portion of that rhetoric might be political speech, protected by the Constitution. But that was the reality of a world in which some people used violence to achieve political goals. The police needed informants and undercover officers to figure out whether political groups were planning criminal acts.

“Without an effectively operating intelligence unit, the department would be unable to deal effectively with the many problems that arise each day in the largest, most complex, and most unique city in the world,” Murphy wrote.

It would take nearly another decade before the lawsuit over the NYPD’s surveillance was resolved. In 1985 the city settled the Handschu case and agreed to court-established rules about what intelligence the NYPD could collect on political activity. Under the rules, the department could investigate constitutionally protected activities only when it had specific information that a crime was being committed or was imminent.

Undercover officers could be used only when they were essential to the case, not as a way to keep tabs on groups. Police could no longer build dossiers on people or keep their names in police files without specific evidence of criminal activity.

To ensure that the rules were being followed, the court created a three-person oversight committee. Two senior police officials and one civilian appointed by the mayor would review each police request for an investigation. Only with the majority approval of that board could an investigation proceed into political activity. Supporters of a lawsuit challenging the NYPD's Muslim surveillance program, hold signs during a gathering on a plaza in front of New York City Police Department headquarters, Tuesday, June 18, 2013. AP Photo/Richard Drew

On the morning of September 11, 2001, Intelligence Division detectives rushed to Lower Manhattan, but when they arrived, they realized their helplessness. They stood there on the street for hours, waiting for someone to tell them what to do. “Stand by” was all they heard. They stood by as World Trade Center 7 collapsed in a plume of dust and smoke and they waited as darkness began to fall on New York. Some were sent toward ground zero to escort surgeons onto the pile, where they conducted emergency amputations or other lifesaving procedures.

Others gathered at the Police Academy, where Deputy Chief John Cutter, the head of the Intelligence Division, put them on twelve-hour shifts. He told them to contact their informants.

It was both the right command and a useless one. Nobody there had informants plugged into the world of international terrorism. But the detectives did what they were told. They called dope dealers and gang members and asked what they knew about the worst terrorist attack in US history.

They worked alongside the FBI out of makeshift command centers aboard the decommissioned aircraft carrier and museum USS Intrepid and in an FBI parking garage, where some detectives sat on the concrete floor. They responded to the many tips called in by a jittery public. They questioned Muslims whose neighbors suddenly deemed them suspicious and visited businesses owned by Arab immigrants.

This was exactly the kind of reactive, aimless fumbling that Cohen wanted to do away with when he came aboard. He envisioned a police force that was plugged into the latest intelligence from Washington and that generated its own intelligence from the city. If an al-Qaeda bomber were ever to set his sights on New York again, Cohen wanted his team to be able to identify the plot and disrupt the plan. The rules needed to change.

* * *

Stolar, the attorney who’d brought the Handschu lawsuit decades earlier, listened on September 20, 2001, as President George W. Bush went to Congress and declared war on terrorism. He knew things were about to change. The way he saw it, once the government declares war on something—whether it be poverty, drugs, crime, or terrorism—the public quickly falls in line and supports it.

But this former radical, who witnessed police fire tear gas and beat antiwar demonstrators during Chicago’s 1968 Democratic National Convention and who was part of some of New York’s most turbulent times, was surprisingly naive about what was to come. He talked to his wife, Elsie, a public defense lawyer, and told her it was only a matter of time before the FBI hunted down the people who planned the World Trade Center attacks. They would be prosecuted in Manhattan’s federal court, he said, and they would need lawyers. Even the worst people in the world deserved a fair hearing and staunch defense. If the choice presented itself, Stolar and his wife agreed, he should take the case. As it turned out, there would never be any criminal trials. The suspected terrorists would be shipped to a military prison in Guantánamo Bay, where the government created a new legal system.

Stolar and his fellow Handschu lawyers also misjudged the NYPD’s response to the attacks. In early 2002, Eisenstein wrote to the city and said that, despite the tragedy, the Handschu guidelines represented an important safeguard of civil liberties. Eisenstein said that he and his colleagues were available if the city wanted to discuss the rules in light of the attacks. The city lawyers said they would consider it. Eisenstein didn’t hear anything for months. Then, on September 12, 2002, a twenty-three-page document arrived from someone named David Cohen.

Cohen’s name wasn’t familiar to Stolar, but as he skimmed the document, it didn’t take long to reach a conclusion: “This guy wants to get rid of us completely.”

The document, filed in federal court in Manhattan, had been months in the making, and Cohen had chosen his words carefully. He explained his background; his thirty-five-year career in the analytical and operational arms of the CIA. Invoking the recent attacks on the World Trade Center, he said the world had changed.

“These changes were not envisioned when the Handschu guidelines were agreed upon,” he wrote, “and their continuation dangerously limits the ability of the NYPD to protect the people it is sworn to serve.”

Like Commissioner Murphy’s affidavit about NYPD surveillance on radical groups in the 1960s, Cohen painted a picture of a nation—in particular a city—under siege from enemies within. Terrorists, he said, could be lurking anywhere. They could be your classmates, your friends, or the quiet family next door.

“They escape detection by blending into American society. They may own homes, live in communities with families, belong to religious or social organizations, and attend educational institutions. They typically display enormous patience, often waiting years until the components of their plans are perfectly aligned,” Cohen said.

He recounted the 1993 World Trade Center bombing, the attacks on embassies in Africa, the 1995 bombing of the Alfred P. Murrah Federal Building in Oklahoma City, and plots against landmarks in New York. America’s freedoms of movement, privacy, and association gave terrorists an advantage, he said.

“This success is due in no small measure to the freedom with which terrorists enter this country, insinuate themselves as apparent participants in American society, and engage in secret operations,” he wrote, adding, “The freedom of our society has also made it possible for terrorist organizations to maintain USbased activities.”

The stakes, Cohen said, could not be higher.

“We now understand that extremist Muslim fundamentalism is a worldwide movement with international goals. It is driven by a single-minded vision: Any society that does not conform to the strict alQaeda interpretation of the Koran must be destroyed. Governments such as ours which do not impose strict Muslim rule must be overthrown through Jihad,” he said.

Faced with this threat, Cohen said, the police could no longer abide by the Handschu guidelines. Terrorists, like the violent radicals of the previous generation, often cloaked themselves behind legitimate organizations. The police had to be able to investigate these groups, even when there was no evidence that a crime was in the works.

“In the case of terrorism,” Cohen wrote, “to wait for an indication of crime before investigating is to wait far too long.”

Copyright © 2013 by A&G Books, Inc. From the forthcoming book ENEMIES WITHIN: Inside the NYPD’s Secret Spying Unit and bin Laden’s Final Plot Against America by Matt Apuzzo and Adam Goldman to be published by Touchstone, a Division of Simon & Schuster, Inc. Printed by permission.