A man has been accused of shooting at and trying to kill a Gaithersburg police officer early Thursday morning.

Four undercover Gaithersburg officers were patrolling the area near School Drive because of thefts from vehicles in the area when someone called 911 to report a suspicious vehicle — which was the vehicle the officers were using — at about 11:25 p.m. Wednesday, Montgomery County police said.

The man called back at about 3 a.m. to say he still wanted to speak with officers. Police saw a man in a mask pacing outside a residence on the unit block of School Drive and approached him to find out if he was the caller.

An officer followed the man, who police identified as 31-year-old Phillip A. Watson, into his residence and called out to him. Police allege that Watson fired multiple shots at the officer with a handgun. That officer, who police did not name, dropped to the floor and another officer fired at Watson, police said.

No one was hit in the exchange.

Watson has been charged with attempted murder, first-degree assault and other related offenses. The four officers have been placed on administrative leave. The officer who fired at Watson is a four-year veteran of the Gaithersubrg police.