The officers were responding to a call in the Hazelbank area at around 9.15pm on Saturday when they heard a loud bang.
They were making their way along the Duncrue towpath at the time of the attack, which police are now treating as attempted murder.
Police say they believe the officers were the intended target of the attack.
They confirmed that an explosive device had detonated after searches, involving police helicopters and army bomb experts, were conducted in the area on Sunday.
No one was injured in the attack; however a PSNI spokeswoman said the officers were left badly shaken.
Those who carried out this attack have shown complete disregard for the safety of the local community and the police officers serving this community.
Chief Superintendent Henry Irvine
District Commander Chief Superintendent Henry Irvine said his colleagues were lucky to be alive.
Condemning the attack, he said: "This is a well-known area that is used every day by members of the local community. It is only by good fortune that police officers and members of the public were not killed or seriously injured last night."
Police say they are extremely keen to speak to anyone who may have witnessed any unusual activity or suspicious vehicles between the early hours of Friday morning and 9pm on Saturday.
Anyone with information is asked to contact detectives in Newtownabbey.
The M5, which was closed between Hazelbank and Greencastle for almost 24 hours, has reopened.
The Duncrue towpath remained closed from Dargin to Fortwilliam on Sunday night.
A number of items have been removed from the scene for further forensic examination.