PORT-AU-PRINCE, HAITI, NOV. 23 -- Masked gunmen attacked an elections commission office and set fire to one of the city's largest open-air markets, kicking off a 12-hour rampage today that left at least two persons dead and 30 or more injured.

The attacks by armed men in civilian clothes, shouting, "Long live the Army," and antielection slogans, came just six days before a presidential election and appeared to be a renewed effort to derail Haiti's first free election ever.

Uniformed soldiers and police stayed in their barracks as armed bands roamed unimpeded through the streets for about two hours before dawn, firing volleys into the air in a half-dozen sections of the city.

Beginning at dawn and continuing into early afternoon, groups of unarmed men set tires afire in at least six places and threw rocks and smashed windows, as they, too, shouted in Creole, "Long Live the Army! Down with the KEP."

KEP is the Creole acronym for the Provisional Elections Council, which has responsibility for running presidential, legislative and local elections under the constitution approved by referendum last July.

Unlike in previous, peaceful antimilitary demonstrations, most people hid today instead of going into the streets. Witnesses said the men, carrying rifles, pistols and clubs, beat several people at the sprawling Marche Salomon market before they set it afire, and one elderly man there was clubbed to death.

At about the same time, the central elections office for the province of Port-au-Prince was sprayed with gunfire, causing minor damage.

Windows were shattered at another Port-au-Prince office in the early afternoon, an elections official said.

"It's incredible," said Jean-Robert Sabalat, the provincial elections chief. "Here we are organizing elections for the whole country, and the police didn't even come to see what happened."

Windows were smashed at a leading presidential candidate's campaign headquarters, as well as a handful of businesses and at least 24 parked cars. Two dozen passengers aboard a private bus were forced to flee when about 12 men doused it with gasoline and set it afire, bus driver Louis d'Orange said.

Jean-Jacques Honorat, director of the Haitian Center for Human Rights, said the violence appeared to have been aimed at provoking massive street demonstrations.

"They are trying to provoke a military coup," he said.

The apparent strategy, Honorat said, is to provide a pretext for the military to postpone the elections on grounds that the atmosphere is inappropriate for the balloting.

The military has dominated the government since dictator Jean-Claude Duvalier fled to France in February 1986.

"They try to provoke us, so the Army will intervene, but we will not be provoked," a modestly dressed man, who would not identify himself, said as he walked among the ashes of the burned Marche Salomon.

A witness to the violence at Marche Salomon, Marie Elene Michaud, who lives nearby and sells charcoal at the market, said that about 30 men in red masks began rampaging after midnight, beating anyone who was about.

They beat down stalls, smashed car windows and poured gasoline on the market's wooden partitions.

"Before the fire, they beat all the people in the market and they kept shouting, "Long Live the Army. Down with the KEP," said vendor Mita Florvil.

A man in his late 20s at the market was killed by a shotgun wound to the head.

A man in his 60s lay with the back of his skull crushed by a blunt instrument.

At least four persons were wounded by gunfire.

"We were in our houses, and the noise was enormous," said Autonas Auguste. "Then the fire started, and the people screamed for help, and we had to run."

The sound of gunfire could be heard across this city of 1 million.

A half-hour or more after the shooting near the market ended, firemen converged on the scene, spraying water on the streets bordering the market so the fire would not spread.

There were reports of scattered shooting after dawn in sections historically dominated by two former associates of Duvalier, who were among 12 men removed from the presidential ballot on Nov. 3.

The constitution bans persons who served the Duvaliers in important capacities from holding public office for 10 years.

Honorat said the timing of the shooting appeared to have been to disrupt the school day.

One of the proscribed candidates, Clovis Desinor, all but threatened violence when his name was removed from the ballot.

Another of the Duvalierist candidates, Alphonse Lahens, said in a television interview today that the Election Council should be disbanded.

In a spate of nightly violence that began earlier this month and abated only two weeks ago, the Elections Council's headquarters were destroyed by arsonists.

From daybreak until early afternoon today, several mobs of up to 50 persons sporadically set fires to tires along city streets and pelted passing motorists with rocks and bottles.

Business here ground almost to a halt. Stores and other markets closed and traffic was unusually light. About half of the city's gas stations shut down.

At Port-au-Prince's only public hospital, officials reported that most of the injured were women and children from the Marche Salomon.

The youngest of the wounded was a boy who appeared to be about 8. He was being treated for a gaping head wound.