A Brooklyn man who had recently separated from his wife and was sharing custody of their 3-year-old son threw the boy from the roof of a 52-story Manhattan high-rise on Sunday afternoon before jumping to his death moments later, the police said.

The man, 35, was killed immediately by the fall; the boy was taken a block away to St. Luke’s-Roosevelt Hospital Center in critical condition, where he died shortly after.

Though many details remained under investigation, detectives began piecing together a picture of the events leading up to the deaths. A police spokesman would not elaborate on why investigators believed the man killed the boy and himself.

The man, identified by the police as Dmitriy Kanarikov, had picked up his son, Kirill, from his wife at 10 a.m. on Sunday from the 17th Precinct station house, the spokesman said. The wife was set to pick him up at 1 p.m. at the station, a neutral location chosen by the couple, said John J. McCarthy, the Police Department’s chief spokesman. They did not show up.