Updated

Masked gunmen attacked opposition protesters camped out at Cairo's Tahrir Square early on Tuesday, firing birdshot at them and wounding nine people, security officials said.

The attack stoked tensions just hours ahead of rival mass rallies in the Egyptian capital by supporters and opponents of the country's Islamist president over a disputed draft constitution.

The charter has vastly polarized the nation and triggered some of the worst violence since Mohammed Morsi took office in June as Egypt's first freely elected president.

It was unclear who was behind the pre-dawn attack on the protesters who have been staging a sit-in at Tahrir for nearly three weeks, said the officials, speaking on condition of anonymity because they were not authorized to talk to the media.

The protesters belong to the liberal opposition, which claims the draft of the charter restricts freedoms and gives Islamists vast influence over the running of the country. The draft, hurriedly adopted late last month by Morsi's Islamist allies, is going to a nationwide referendum on Saturday.

The dispute prompted hundreds of thousands of the president's opponents to take to the streets in massive rallies -- the largest from primarily secular groups since the uprising that toppled Hosni Mubarak last year. Morsi's supporters responded with huge demonstrations of their own, which led to clashes in the streets that left at least six people dead and hundreds wounded.

There have been at least two dozen attacks on offices of Morsi's Muslim Brotherhood, according to the group's leaders. Meanwhile, senior opposition figures, including former lawmakers, have been badly beaten by pro-Morsi Islamists.

Also in Cairo, several hundred Islamists were camped out Tuesday outside a media complex on the western outskirts of Cairo that is home to several independent TV networks critical of Morsi and the Brotherhood. The Islamists have threatened to storm the complex.

The opposition has yet to decide whether to campaign for a "no" vote or call for a boycott of Saturday's referendum -- something many see as a reflection of divisions within the opposition. The disparate opposition groups are led by reformist and Nobel Peace prize laureate Mohamed ElBaradei, Egypt's former foreign minister and Arab League chief Amr Moussa, and leftist politician Hamdeen Sabahi.

Cracks in the opposition's unity first appeared last weekend when one of its leading figures, veteran opposition politician Ayman Nour, accepted an invitation by Morsi to attend a "national dialogue" meeting. On Monday, another key opposition figure, El-Sayed Badawi of the Wafd party, met Morsi at the presidential palace.

The opposition has said it would not talk to Morsi until he shelves the draft constitution and postpones the referendum.

Anticipating unrest on the day of the referendum, Morsi has ordered the military to join the police in maintaining security and protecting state institutions until after the results of the vote are announced. The decree went into effect on Monday.