A Brazilian politician has been accused of opening fire on protesters who had mobbed a public security ministry headquarters.

Ari Pereira, deputy minister for security in the eastern Brazilian state of Bahia, was reported to have shot at a group of demonstrators who had broken into the ministerial building in the state capital of Salvador.

In a picture taken at the scene, Pereira is shown aiming a gun downwards from a first-floor balcony overlooking a courtyard where protesters had gathered.

Local media said that three shots were heard but there were no reports of injury.

The ministry contended that just one warning round was fired to scare off demonstrators who were trying to reach the upper floors of the ministry building.

A ministry spokesperson told Jornal Do Brasil newspaper that protesters had tried to snatch a gun from a security guard and were armed with machetes and batons.

The ministry would not confirm who fired the shot.

Demonstrators were members of the one million-strong Landless Workers' Movement (MST), which fights for land reform.

About 1,000 activists had arrived at the ministry to protest over the death of one of their leaders, Fábio dos Santos Silva, who was gunned down in April.

At the end of the tense standoff some MST representatives met Pereira's boss, Mauricio Barbosa.

The state of Bahia is ruled by President Dilma Rousseff's leftist Workers' Party.