MANAMA, Bahrain  As security forces and pro-government vigilantes beat back protesters here, Defense Secretary Robert M. Gates arrived Friday on an unannounced visit to offer American support to the royal family and prod the king and the crown prince toward talks with protesters demanding more democracy.

His visit took place against a backdrop of large and continuing protests across numerous Arab capitals on Friday, with neither repression nor government concessions stemming the tide of anger and demands for change.

The region’s protests were for the most part peaceful, although there were scattered reports of injuries.

Here in this tiny Persian Gulf kingdom, security forces firing what protesters said were rubber bullets and pro-government Sunni vigilantes wielding sticks and swords beat back a rump group of several hundred protesters who were among the tens of thousands of Shiite demonstrators who were planning to march toward a particularly sensitive area: the Royal Court in Riffa, the preferred residential neighborhood for the ruling family and the Sunni Muslim elite. Its manicured lawns and wide streets contrast sharply with the narrow alleyways and raw cinder-block houses where many of the majority Shiite Muslims live.