Ismaaiyl Abdullah Brinsley, 28, had a history of violence and mental instability.
Candlelit vigils have been held in New York in memory of the two officers, Liu Wenjin and Raphael Ramos.
Ismaaiyl Brinsley shot officers as they sat in their patrol car in Brooklyn before running into a nearby subway station and reportedly shooting himself.
He had posted messages on social media saying he would kill police officers in retaliation for the death of Eric Garner, a black man who died when white police officers arrested him.
The Rev Al Sharpton, a prominent civil rights activist, said Eric Garner’s family had no connection to the gunman and called the killings “reprehensible”.
Community leaders have called for peace and the mayor of New York, Bill de Blasio, has ordered flags across the city to be flown at half-mast.
Ismaaiyl Brinsley had been arrested at least 19 times and had a troubled childhood so violent that his mother was afraid of him, police said.
In online postings, he expressed “self-despair and anger at himself and where his life was”, Chief of Detectives Robert Boyce said.
Before the shootings, Ismaaiyl Brinsley shot and wounded a former girlfriend.
The killings come at a tense time, with nationwide protests over the deaths of unarmed black men at the hands of police officers.
The attacks have also put pressure on the New York mayor.
Officers turned their back on him at a news conference, angry at what they saw as his support for protests against the police.
iF8uQKNDKuwMisleading allegations, rumours and outright lies about voting and fraud are flooding online spaces in…
At least 158 people have died in Spain's worst flooding disaster in generations. On October…
Google has been fined two undecillion (a two followed by 36 zeroes) roubles by a…
Embarking on a home remodel is an exciting journey, promising enhanced comfort, increased property value,…
The US presidential candidates continued to campaign across key swing states on October 20. Footage…
Elon Musk has said he will give away $1 million a day to a registered…