Saudi security forces killed two men who opened fire on police during a raid on a farm in eastern Saudi Arabia used by militants to plot and prepare for attacks, the interior ministry said on Wednesday.

The Mokhtar Brigades, a little known Shi'ite Muslim militant group based in neighbouring Bahrain, identified the two men as Meqdad al-Nimr and Mohammed al-Nimr, describing them as "martyrs".

SPA said security forces came under fire while conducting a search in a farm outside the town of Awamiya.

"The source of gun fire was dealt with immediately and neutralised and the mission was completed successfully," the statement said, adding that four other people with a history of involvement in "terrorist and criminal acts" had been arrested.

No policemen or innocent citizens were hurt in the raid, it said.

Activists posted photos of one of the two men with two bullet holes in the back and one in the head.

The incident came less than three weeks after a wanted militant suspect was fatally wounded during an operation by Saudi security forces in Awamiya. Residents said at the time the victim was a 16-year-old bystander.

The town has been the focal point of opposition to the ruling Al Saud ruling family since 2011, when mass protests by local Shi'ite Muslim residents rocked the area demanding more equality and an end to what they see as discrimination.

Saudi Arabia denies discriminating against the Shi'ites.