An off-duty Baltimore City police officer shot and killed a man in Anne Arundel County when the man tried to rob him early Saturday, police said.

Police say Edel Cato Moreland, 32, approached the off-duty officer, who was not in uniform, with what appeared to be a revolver. The 41-year-old officer, who police have not identified publicly, pulled out his service weapon and shot Moreland. Moreland, who police said “suffered from apparent gunshot wounds,” was pronounced dead at the scene.

Anne Arundel County police said that it was later determined that the suspect’s weapon was “a realistic-looking all-black toy gun resembling a revolver.”

Police said the off-duty Baltimore officer is an 18-year veteran assigned to the department’s special operations section.

Lt. Ryan Frashure, Anne Arundel County police spokesman, said the case will be forwarded to the office of the state’s attorney for review to determine whether any charges are applicable.

The incident occurred about 1:36 a.m. in the 100 block of Homewood Road, a residential area in Linthicum Heights. Frashure said investigators believe the officer had just gotten off work and was stepping out of his vehicle when the suspect pointed the fake gun at him. The officer had his service weapon in a bookbag, took it out and shot the suspect multiple times at close range, police said.

“It was dark and it happened very quickly,” Frashure said. “It is a very tough situation for the officer to be in. Obviously, it is a tragedy . . . we hate to see anyone lose their life.”

Police say they believe Moreland had been homeless for the past few weeks. It is unclear whether he had friends or relatives in the county.

The shooting comes at a time when there is growing tension about police use of force across the United States, particularly in confrontations between white police officers and minorities. In the Anne Arundel case, both the officer and Moreland are white, police said.

Baltimore City police spokeswoman Chakia Fennoy declined to provide details about the officer and said the agency will not release the officer’s name Saturday. She referred all questions to Anne Arundel County Police.

Authorities said they are investigating the shooting. Anyone with information can call police at 410-222-4731 or the Anne Arundel County Police tip line at 410-222-4700.