The RCMP says it 'cannot stress enough the dangers of carrying toy and replica firearms.' (CBC)

An encounter with an 18-year-old man with a plastic cap gun has prompted RCMP to warn Islanders about the danger of carrying a toy that could be mistaken for a real firearm.

RCMP in Prince Edward Island say an officer on patrol early Sunday pulled over a vehicle on the highway near Wellington Centre. He suspected that the driver had been drinking.

When the driver moved around to get his documentation, the officer spotted what looked like the handle of a revolver tucked under the seat.

The officer arrested the 18-year-old driver and two passengers, and called for backup.

Other RCMP officers and members of the Summerside Police Service answered the call.

Cpl. Stephen MacDonald, with Prince District RCMP, said police performed a "high-risk takedown," where they removed the people inside the vehicle for the safety of everyone involved.

Officers searched the vehicle and found a cap gun. The driver apologized and said he didn't mean any harm, RCMP said in a statement.

RCMP said the driver faces charges related to impaired driving.

But police say this is a lesson for everyone.

"Police cannot stress enough the dangers of carrying toy and replica firearms, especially when possessed by adults in the middle of the night," Prince District RCMP said in the release.

"In such situations officers are forced to make split second decisions which could quickly turn tragic for all those involved."

MacDonald said officers reacted as they're trained to do.

"Setting aside what happened in Moncton, our members last night didn't do anything different than they would have done from last week. They acted accordingly to the way they've been trained," he said.

Three RCMP officers were shot and killed and two others injured Wednesday in Moncton. 

The suspected gunman in that case is a 24-year-old man. Justin Bourque has been charged with three counts of first-degree murder and two counts of attempted murder.