GDANSK, Poland (AP) _ Lech Walesa laid a wreath today at a monument to slain workers as up to 2,000 Solidarity supporters sang the Polish national anthem and waved their hands in the ''V'' for victory symbol.

Meanwhile in the southwestern Polish city of Wroclaw, an opposition activist said police broke up a Solidarity rally by about 500 people. Ten people were reported detained.

Both the wreath-laying in Gdansk and the Wroclaw demonstration were to mark the seventh anniversary of the signing of the Gdansk and Szczecin accords between Poland's communist government and striking workers. The accords officially recognized Solidarity, the trade union movement that was later suppressed and outlawed under martial law.

Uniformed and plain-clothed police looked silently on as Walesa led a dozen or so followers through the crowd to the base of the Gdansk monument, built to honor 27 workers killed by security forces during anti-government demonstrations in 1970.

People who had started gathering about an hour earlier cheered and chanted ''Solidarnosc,'' Polish for Solidarity, when Walesa arrived.

Before the wreath-laying ceremony, individual workers or small groups of Poles visited the site or laid flowers at the base of the memorial, a circle of three metal crosses soaring 140 feet into the air.

The accords signed on Aug. 30-31, 1980, for the first time gave workers in a Soviet bloc nation the right to form independent trade unions. They also promised increased freedom in the news media and improvements in working conditions, housing and medical care.

Both Solidarity and the government claim to have been faithful to the Gdansk and Szczecin agreements, and accuse the other side of violating them.

Solidarity was outlawed after martial law was imposed in Poland in December 1981. The government said anti-socialist elements had taken over Solidarity and were trying to overthrow the government. Martial law was lifted in 1983, but Solidarity remains banned.