(Adds background, details)
ABUJA, Sept 20 (Reuters) - Nigerian forces and members of Boko Haram clashed in a shootout near a residential compound for lawmakers in Abuja on Friday, the first clash involving Islamist militants in the capital this year.
State security services said a team had been searching in an area behind Apo Legislative Quarters for weapons after a tip-off from arrested Boko Haram members, a militant group that wants to impose sharia law in northern Nigeria and has been responsible for hundreds of killings this year.
Boko Haram is seen as the gravest security threat to Africa's top oil producer. Although its activities are mostly located hundreds of miles away from its southern oil fields, its small presence in the political capital worries officials.
"Some persons were injured and 12 others have been arrested in connection with the incident," said a statement from the state security services, Nigeria's secret service.
"No sooner had the team commenced digging for the arms, than they came under heavy gunfire attack by other Boko Haram elements," the statement said.
Apo is a large, high-end development originally designed for legislators while they are in office but now occupied by a mixture of lawmakers, other politicians and retired officials.
It houses the two top lawmakers: Senate President David Mark, the country's third most powerful person, and Aminu Tambuwal, speaker of the lower house.
The last known attack by the sect in Abuja was in November last year, when gunmen stormed a special anti-robbery police barracks and freed 30 prisoners, killing two police officers. That attack was claimed by Ansaru, a Boko Haram offshoot.
By far the most high-profile attack in the capital was in August 2011, when a suicide car bomb tore through the U.N. building, killing 24 people and gaining Boko Haram international notoriety.
The bulk of Islamist attacks occur in the remote northeast, where Boko Haram had its first major uprising in 2009.
President Goodluck Jonathan's government declared a state of emergency in three northeastern states in May after an intense period of attacks by Islamists on security forces and civilians.
The military crackdown initially appeared to be having some effect, but there has been a resurgence in attacks in the last two months.
Nigeria's military said it had killed 150 insurgents this week, including a commander, in an operation in which 16 of its own forces were also killed.
In a separate attack on Tuesday, Boko Haram gunmen killed at least 20 people travelling along a road heading south from Borno, witnesses told Reuters. (Reporting by Camillus Eboh; Writing by Joe Brock; Editing by Tim Cocks, Alison Williams and Sonya Hepinstall)