Indonesian media said police believed that one of those killed was a key organizer of the twin suicide bomb attacks on luxury hotels in Jakarta in July that killed seven people.
National police spokesmen did not immediately confirm any details of the raid, saying the police chief would hold a news conference later Friday.
An anti-terror police officer, speaking on condition of anonymity because he was not authorized to speak to the media, told The Associated Press that two militant suspects died in the raid and two others were taken into custody.
Police raided the house in Tangerang district about 12 miles (20 kilometers) southwest of Jakarta midmorning Friday, the television networks TVOne and MetroTV reported.
The television networks showed heavily armed police outside a house in the district, and an ambulance driving away from the scene.
TVOne named the two suspects killed in the raid as Syaiffudin Zuhri and Muhamad Syahrir, without giving a source.
Zuhri is alleged to be a top leader of an al-Qaida-linked militant group blamed for a string of bombings in Indonesia, and to have recruited the hotel bombers.
The leader of the group blamed for those attacks, Noordin Top, was shot dead during a police raid last month.
Documents in a laptop computer found with Noordin's body said Zuhri joined an al-Qaida affiliated group called Salafi Jihadi during studies in Yemen.
He held a prominent position in Tanzim Qaidat al-Jihad _ a group that was headed by Noordin _ since 2005.
Police believe that Zuhri sought funding overseas for terrorist attacks in Indonesia.