Unidentified gunmen have shot dead five people in Saudi Arabia's eastern province, the state news agency reported.

Nine people were also wounded in the attack in al-Dalwah town in al-Ahsa district, a police spokesman was quoted as saying on Monday.

"As a group of citizens was leaving a building... three masked men opened fire at them with machine guns and pistols," the spokesman said, adding that the incident was under investigation.

It gave no further details. Al-Ahsa is one of the two main centres of minority Shia Muslims in Sunni ruled Saudi Arabia, along with the district of Qatif.

Videos purporting to show the aftermath of the attack posted on social media showed a body lying in a pool of blood outside a building, with people milling around calling for help. The authenticity of the videos could not immediately be verified.

Shia Muslims worldwide are holding ceremonies marking Ashoura, a 10-day event commemorating the death of the Prophet Mohammad's grandson Imam Hussein in battle 1,300 years ago.

Qatif and Al-Ahsa have historically been the focal point of anti-government demonstrations.

Shias say they face discrimination in seeking educational opportunities or government employment and that they are referred to disparagingly in text books and by some Sunni officials and state-funded clerics.

They also complain of restrictions on setting up places of worship and marking Shia holidays, and say that Qatif and al-Ahsa receive less state funding than Sunni communities of equivalent size.

The Saudi government denies allegations of discrimination.