A B.C. man has been arrested for allegedly attempting to carjack unmarked police cruiser — with two officers still inside.

On Monday, the suspect approached the parked car and tried to pull one of the undercover officers from the driver’s seat in Surrey, RCMP said in a news release.

The officers quickly identified themselves, and arrested Kyle Berg, 25, of Penticton. He remains in custody.

“This had the potential to be a frightening incident and we are thankful that our officers were in the right place at the right time to take this person into custody,” said Cpl. Scotty Schumann. “The suspect got the ride he wanted, but probably not to the location he was hoping for.”

Berg was already wanted for wearing a disguise with intent, and RCMP said they'll be recommending charges of robbery and breach of probation.