A knife-wielding man was shot and killed by a Maryland police officer in Anne Arundel County. (iStock)

A knife-wielding man who was shot last week by police has died, officials said.

The incident unfolded just before 10 p.m. Friday on Route 50, near Davidsonville Road in Hanover. When rescuers got there, the man who witnesses later said had been walking and standing in the road came at them with a knife, according to officials with Anne Arundel County Police.

Officers ordered him to drop the weapon, but he did not, and an officer fired one shot that hit him. The man — who was later identified as Martin Allen Goodier, 56, of Bowie — was taken to an area hospital in grave condition.

Goodier died Tuesday at the hospital. Officials said an autopsy will be done. Goodier was a volunteer firefighter in Prince George’s County, officials said.

The Anne Arundel police officer who was involved in the shooting is a 20-year veteran of the department who is assigned to the Bureau of Patrol.