Baltimore police said Tuesday they arrested a hospital security guard in a case in which a woman reported she was sexually assaulted by a man who said he was a police officer.

Officials had said earlier that they were looking into the possibility that a Baltimore officer was involved in the attack, and had taken more than 100 patrol cars off the streets to search for evidence.

Police Commissioner Michael Harrison said at a news conference Tuesday evening that he was “relieved” that the suspect turned out not to be a member of the department, or a police officer at all.

At the news conference, Harrison said the attack occurred June 1, when the victim reported being ordered out of her vehicle in Baltimore by an assailant who identified himself as a police officer, demanded she get into his car, and later assaulted her.

He said the investigation indicated that the assailant wore a security guard uniform, not a police uniform. He also said the vehicle involved in the attack was a dark-colored, privately owned sedan, not a police vehicle.

Harrison identified the suspect as Richard Barnes, 50, of E. Northern Parkway in Baltimore.

Barnes works as a security guard, possibly with a contract security service, at the University of Maryland Shock Trauma Center, Harrison said.

Harrison said Barnes was charged with rape, assault and impersonating a police officer. Attorney information for Barnes was not immediately available Tuesday night. A person who answered the phone at a number listed for Barnes hung up without comment.

The University of Maryland Medical Center released a statement saying officials there were “shocked and saddened to learn of the allegations and are cooperating fully with the investigation.”