RCMP say the officer was in the area of the 25800 block of Spilsbury Road around 3:30 a.m. PT when he saw two males hiding in the bushes, acting suspiciously.
When the officer approached the two men, they fled on foot. Police say the officer got into his vehicle and was continuing the pursuit when one of the suspects pulled out a gun and fired at the officer and his vehicle.
Police were unable to locate the men despite an extensive search of the area.
Police said they believe the men fled from the area in a vehicle.
"This was an overt act of violence towards a uniformed police officer that will not be tolerated in our community. Fortunately, no one was injured in this incident, but we are aggressively pursuing all leads to identify these individuals and hold them accountable for these violent actions," said RCMP Cpl. Alanna Dunlop in a statement.
The suspects are described as dark-skinned men wearing dark-coloured hoodies.