A device exploded in Northern Ireland near the border with Ireland early on Monday in what police said was an attempt to kill officers looking into an earlier incident.