Police imposed a curfew and went door to door on Friday searching for escaped local al-Qaida leaders in the western Iraqi province of Anbar.
The three militants broke out of the al-Fursan police station in the city of Ramadi earlier in the day, during a shootout that killed 13 people.
Anbar's police chief, Major-General Tareq Yusuf, says the clashes began when a prisoner told a guard he was ill and asked to be escorted to a bathroom. The inmate overpowered the guard, stole his weapon and killed him.
Some of the detainees escaped in the ensuing shootout. At least six police officers and seven prisoners were killed. At least four policemen were wounded.
Ramadi is the capital of Anbar province, which was once the heart of the Sunni insurgency against U.S.-led forces following the overthrow of Saddam Hussein's regime in 2003.
Violence in the area has eased significantly since local Sunni tribes began helping the U.S. military fight al-Qaida and other militants in 2006. The United States handed security control of Anbar to Iraq's government in September.