General Khalaf Alussi died under a hail of bullets fired by four men, said Wissam Idan, a building worker at the house in Baghdad's al-Yarmuk area.
The general, who died on the spot, headed the feared secret police in the al-Kharkh district on the west bank of the river
The attack came as US Defence Secretary Donald Rumsfeld visited Baghdad and the northern oil centre of Kirkuk for talks with field commanders on counter-insurgency efforts.
A number of violent incidents coincided with the visit.
A member of the paramilitary Iraqi civil defence corps (ICDC) was wounded in a rocket attack north of Baghdad as US troops launched a major operation against insurgent bombers west of the capital.
"At 9:30 am (0630 GMT) a rocket hit our camp where dozens of IDC personnel are based and Sabbah Salem Jassem was wounded in the arms and legs," said the corps commander.
Rumsfeld drops in
Rumsfeld's unannounced visit, his third since the US-led invasion of Iraq, came after the US military launched counter-insurgency operations around the capital and in north-central Iraq to root out those responsible for carrying out resistance attacks against American troops and their allies.
Rumsfeld flew directly to a military base on the southern outskirts of Baghdad in a swarm of Black Hawk helicopters, avoiding the capital's international airport, which has been targeted by resistance missile fire.
At a base of the 82nd Airborne Division, he inspected the training of the new Iraqi Civil Defence Corps that US commanders hope will play a bigger role in Iraq's security as Washington restructures its forces and sends some of its troops home.
Security was extraordinarily tight everywhere Rumsfeld went. In the northern city of Kirkuk, a 50-minute meeting with Iraqi officials, which had been due to take place in the governor's office, was switched to a safe house in the city for security reasons.
Rumsfeld drove to the safe house in Kiruk in a convoy of mud
spattered Humvees. Troops sealed off the streets surrounding the mansion.
US army says resistance attacks
are down to 22 incidents a day
The US defence secretary was also briefed on counter-insurgency efforts by Major General Raymond Odierno, commander of the 4th Infantry Division, which patrols the flashpoint areas of north-central Iraq.
"We are now down to 22 incidents a day," he said, adding that US forces were now finding up to 70% of roadside bombs before they were detonated.
Odierno said intelligence tips from Iraqis had been pouring in since the US army launched two major counter-insurgency operations north of Baghdad and around the capital in mid-November.
He added that about 20 of the 32,000 troops in his division had been killed since President George Bush declared an end to hostilities on 1 May. A total of 40 had been killed since the start of the six-week spring invasion.
"Every one of them is tragic, everyone of them is a great human being," said Odierno. But he added that the combat deaths accounted for only one tenth of one percent of his forces.