A security officer reported feeling a pain in her leg, before looking down and seeing an airgun pellet on the ground near her foot, according to Eckhard Deutschmann, spokesman for the Erfurt police.
He said several shots were fired between 7 am and 8 am - aimed at the security officers controlling the entrance to the Domplatz where Pope Benedict XVI was due to say mass just a couple of hours later.
Police said no-one was injured, but that they had established that the shots had come from a nearby attic flat, where several people were to be found.
Officers tried to make contact with them, and then, according to reports, waited until the end of the mass before breaking down the door and arresting a man.
The pope's retinue immediately seemed sure the incident had nothing to do with him.
Vatican spokesman Federico Lombardi said it was "an incident that had nothing to do with the pope" and that "the pope has not been informed."
"No one noticed," Lombardi said. The shots were fired two hours before Benedict began his celebration of the mass for around 30,000 people.
"According to the German police, it seems to be the action of an unbalanced person," added Lombardi.
Security for the pope's visit Germany has been extremely tight. Large parts of Berlin, Erfurt and Freiburg were locked down for the trip amid a colossal police presence. People living along the route along which the pope was due to drive in Berlin were told to keep their windows closed as he passed by.