Police spokesman Anthony Guglielmi says the man was shot and killed by officers Thursday afternoon.
The doctor, who was shot in the stomach, was rushed to surgery and is expected to survive.
"The doctor will be OK," Guglielmi said. "He's in the best place in the world - at Johns Hopkins hospital."
Guglielmi does not know the relationship between the gunman, described as a man in his 30s, and the doctor.
The hospital said in a statement that the doctor is a faculty physician but it could not release more information because of privacy policies.
A small area of the hospital remains locked down and police are executing a tactical operation to capture the suspect.
Hopkins spokesman Gary Stephenson said the affected area was the eighth floor of the Nelson building, which is the main hospital tower.
According to the Hopkins website, the eighth floor is home to orthopedic, spine, trauma and thoracic services.
About a dozen officers wearing vests and helmets and carrying assault weapons prepared to enter the hospital at midday. The FBI is also helping Baltimore police, FBI spokesman Richard J. Wolf says.
The rest of the massive hospital, research and medical education complex in remains open, including the emergency department, and patients can report for treatment and appointments.
People with appointments in other parts of the hospital are encouraged to keep them.
Earlier, a hospital spokesman said the gunman had been caught. Police later said that was not the case.
A number of roads near the hospital have been shut down, including roads near Broadway, East Monument and North Wolfe streets, the Baltimore Sun reports.
With more than 30,000 employees, Johns Hopkins Medicine is among Maryland's largest private employers and the largest in Baltimore. The hospital has more than 1,000 beds and more than 1,700 full-time doctors.