A man suspected of carjacking a taxicab in Gaithersburg yesterday and severely beating the cabdriver was later shot and killed by a National Park Service ranger during a struggle at a Potomac River boat ramp, police said.

Montgomery County police Capt. Nancy Demme said that police had issued an alert about the stolen Regency cab but that the ranger "was unaware when he approached the vehicle that it had actually been stolen in a carjacking."

Police said the ranger approached the suspect about 8 a.m. as he stood near the cab, which was parked on a boat ramp at the end of River Road in Poolesville. The man appeared suspicious, police said, because he was "wearing only a short-sleeve shirt" in the freezing weather.

Police gave few details of the shooting, except to say that the suspect had been shot with the ranger's gun after a struggle.

Police did not identify the dead man late yesterday afternoon, pending notification of family. Police also did not identify the ranger nor the victim of the carjacking. The ranger was put on routine administrative leave for three days, Demme said.

The carjacking happened about 1 a.m. yesterday after the cabdriver stopped for a man and a woman in the 700 block of West Side Drive, Demme said.

Soon after, the woman left the cab, police said, and the man then demanded money from the driver. The cabdriver was beaten and left in the road, Demme said.

The cabdriver was found in the 900 block of West Side, police said, and was treated at a local hospital and released.