HAMBURG — German security forces clad in riot gear clashed with protesters on the eve of the Group of 20 summit here, using water cannons and pepper spray to disperse a group with anarchist sympathies that had refused to stand down.

The skirmish followed an hour-long standoff on a street that runs alongside Hamburg’s downtown harbor. Thousands of protesters were gathered, and some began lobbing glass bottles and other objects as police rushed a group of “black bloc” activists huddled in the middle of the street. They were dressed in dark clothes with their faces concealed and carried signs condemning the state and promising, “Welcome to hell.”