Mr Trump also commented on the shooting, and savaged the gunman.
He said the gunman was one of many “animals that must be hit hard”.
In response to his son’s, Donald Trump Jr, post calling for prayers for the deputies, Mr Trump said: “If they die, fast trial death penalty for the killer.
“Only way to stop this!”
Mr Trump has made “law and order” central to his re-election campaign, and has frequently attacked Democrats for wanting to “defund the police”.