The firefight ocurred in the remote village of Bocas de Ayapal, more than 160 kilometers north of the capital Managua.
The robbers opened fire on soldiers trying to stop them, police said in a statement.
The gun battle left six would-be robbers and four police dead, it said.
A policeman was injured and one attacker was arrested.
The clash happened in mountainous Jinotega department on the border with Honduras, where violence is on the rise because of what the authorities call common criminals, although the opposition says they may be rebel groups.