Gunmen assassinated a judge as he headed to work in Baghdad on Monday, while to the north, a booby-trapped house exploded as Iraqi police searched the building, killing at least two officers and trapping five beneath the rubble, authorities said.

Amir Jawdat al-Naeib, a high-ranking judge at the appeals court and a member of the Supreme Judicial Council, was ambushed by gunmen in two cars in the Mansour district of western Baghdad as he was being driven to work from his home, police and Deputy Justice Minister Busho Ibrahim said. His driver was also killed.

Professionals, including academics, government officials, doctors, lawyers and judges, have often been targeted in recent years in Iraq. In October, an investigative judge in the northern city of Kirkuk, Zaher al-Bayati, narrowly escaped assassination when gunmen in a vehicle opened fire on him, killing two of his bodyguards.

Separately, a booby-trapped house in Buhriz, about 35 miles north of Baghdad exploded as Iraqi police searched the building, trapping at least seven officers in the rubble, a Diyala police official said.

A doctor in Baqouba General Hospital said two bodies were pulled from the debris, and that rescuers were looking for the remaining five. Another four policemen were seriously wounded, a police official said.

Both spoke on condition of anonymity because they were not authorized to release information to the media.

Buhriz is near Baqouba, the capital of the restive Diyala province. Last week, six U.S. soldiers were killed and four were wounded in a similar incident, as they searched a booby-trapped house in Diyala.

Last week, the U.S. military launched a major operation, dubbed Phantom Phoenix, to go after al-Qaida in Iraq and other extremists. While the operation is countrywide, parts of it are focusing on Diyala, which lies mainly to the northeast of Baghdad and has become a focus for al-Qaida after they were pushed out of Anbar province west of the capital.

In Baghdad, meanwhile, gunmen who apparently followed two Iraqi soldiers from a military camp opened fire on them, killing both, said a police official, who did not want to be named as he was not authorized to speak about the shooting.