In an earlier paper, the second-named author has described the identities holding in the so-called Catalan monoids. Here we extend this description to a certain family of Hecke--Kiselman monoids including the Kiselman monoids $mathcal{K}_n$. As a consequence, we conclude that the identities of $mathcal{K}_n$ are nonfinitely based for every $nge 4$ and exhibit a finite identity basis for the identities of each of the monoids $mathcal{K}_2$ and $mathcal{K}_3$. In the third version a question left open in the initial submission has beed answered.