A knife-wielding man was taken to the hospital after being shot by police in Escondido on Wednesday afternoon.

Around 12:10 p.m., Escondido Police Officers began receiving multiple reports of a man acting erratically in the intersection of Centre City Parkway and Felicita Avenue, according to SDPD Lt. Chris Tivanian. Callers told police the man was holding a knife and approaching drivers as they drove by.

The man, identified by police as 54-year-old Juan Ramos, then walked north in the southbound lanes, arriving at the intersection of 13th Avenue and Centre City Parkway, Tivanian said.

An EPD detective in plainclothes was the first of law enforcement to arrive on scene. He emerged from his vehicle and at the same time, additional officers arrived, which is when Ramos rushed at the plainclothes detective, prompting the detective and two uniformed officers to shoot, striking him, SDPD said.

In a video taken by a bystander, officers can be heard ordering Ramos to drop the knife and stay down before they shoot at him multiple times.

He fell to the ground, writhing, before getting back up and heading towards the officers, who again shoot at him multiple times.

Ramos attempts to get back up, only to get shot at multiple times again.

“Officers gave repeated orders for the suspect to drop the knife, that they wanted to get him help and attention for the gunshot wounds he’d incurred,” Tivanian said.

“At that point, officers showed incredible restraint, and while he was armed with a knife, they got a less-lethal device, which is basically a 40 millimeter rubber bullet weapons system. They impacted him four to five times,” Tivanian said.

One of those rounds knocked the knife out of the man’s hands, Tivanian said, allowing officers to apprehend him. Another video obtained by NBC 7 showed about a dozen officers restraining him onto the ground, where he was taken in custody.

Ramos was then taken to a hospital, where he underwent surgery and is expected to survive his injuries, Tivanian said. He faces charges for assaulting a peace officer with a deadly weapon, SDPD said.

Tivanian later clarified to NBC 7 that the first two volleys of fire were shot from officers’ handguns, while the third was the 40 millimeter rubber bullets.

No officers were injured, officials said.

According to SDPD, the two officers have been employed by the EPD for about eight months and 17 years, while the detective has been with the department for about three years.

Multiple law enforcement vehicles continued to shut down the intersection after the incident occurred. Centre City Parkway was blocked off for hours from 13th Avenue to Felicita Avenue while investigators gathered more information, NBC 7’s Jeanette Quezada said.

The San Diego Police Department took over the investigation. San Diego County law enforcement agencies have a memorandum of understanding that prevents departments from investigating shootings involving their own officers.

This is a developing story. Check back on this page as NBC 7 continues to update this with more information as it arrives.