Joseph Coffey, a New York City detective sergeant who took the confession of the serial killer known as Son of Sam, arrested John J. Gotti three times, trailed a minor mobster from Little Italy to Germany in a case that implicated the Vatican Bank, and danced with Nancy Reagan at the Waldorf one night when he was assigned to guard her, died on Sept. 27 at his home in Levittown, N.Y. He was 77.

The cause was complications of a heart condition, his wife, Susan Elise Coffey, said.

“He was instinctive, he understood people, and when you were in his cross hairs he knew everything about you,” said Jerry Schmetterer, who collaborated with Sergeant Coffey on “The Coffey Files: One Cop’s War Against the Mob,” which was published in 1992.

Sergeant Coffey’s other exploits included the investigation of the 1978 Lufthansa heist at Kennedy International Airport (about $5 million in cash was stolen from a cargo-area vault) and the 1975 bombing of Fraunces Tavern in Lower Manhattan by the Puerto Rican nationalist group F.A.L.N.

Later, as the principal investigator for New York State’s Organized Crime Task Force, he pursued the so-called Commission Case against the bosses of the city’s top organized crime families. (Four were convicted in 1986, and another was killed under orders by Mr. Gotti and succeeded by him.)