The authorities said the suspect had for months failed to pay local taxes or vehicle fines and drove away officials who had tried to collect them from his home in Georgensgmünd, about 25 miles south of Nuremberg.

The police said the man had a hunting license, which gave him the right to own firearms, but the authorities declared him unfit to own weapons after his failure to respond to the repeated summons. A special police unit was sent to seize his collection, said to contain at least 30 guns.

Another officer was recovering from a gunshot wound sustained in the raid, and two others were lightly wounded, the police said. The suspect is to be questioned and brought before a judge on Thursday. He could face murder charges.

The gunman belonged to a group that calls itself the Reichsbürger, or Reich Citizens, which still recognizes Germany’s 1937 borders and has a history of confrontation with the police. The group is thought to have a few hundred members, said Norbert Plate, a spokesman for the federal Interior Ministry.

Police officers getting shot in the line of duty is relatively rare in Germany, and Wednesday’s shooting shocked the authorities in Bavaria. The development prompted criticism that security officials had shifted their focus too heavily on combating Islamic terrorism, while neglecting the threat of local right-wing groups.