Militants have stormed a university in the Iraqi city of Ramadi, briefly taking dozens of students and staff hostage before retreating under fire.
At least two people died in the attack, but officials said security forces were now back in control of the campus.
The militants were said to be from the Islamic State in Iraq and the Levant.
The western province of Anbar is a focal point of Iraq's rising sectarian violence, with a number of areas controlled by Sunni militants.
The areas include parts of Ramadi, where the militants have been battling security forces of the Shia-led government for months.
Hours after the Ramadi attack, a series of car bombs hit the Iraqi capital, Baghdad, killing at least 25 people and injuring dozens.
Prime Minister Nouri Maliki has been blamed for failing to stop the spiralling the sectarian violence, which has left more than 3,500 people dead this year.
His Shia-led alliance won parliamentary elections held on 30 April, but fell short of a majority. The violence in Anbar meant there was no voting there.
Mr Maliki wants a third term, but other parties have voiced strong opposition and accuse him of trying to monopolise power.
He blames external factors like the conflict in Syria for exacerbating the violence, and his opponents for the current political stalemate.
Saturday's attack was the third major assault by insurgents in as many days following raids on Mosul in the north and the central city of Samarra.
Police said militants had infiltrated the campus in the early hours from the neighbouring al-Tasha district, blowing up a bridge to the university's main gate.
Security personnel sealed off the campus and one Agence France-Presse reporter said special forces had led an assault.
One student, Ahmed al-Mehamdi, told the Associated Press news agency by telephone that he awoke to gunfire and saw armed men running across the campus.
The gunmen entered the dormitory and told everybody to stay in their rooms. Some students were taken to other buildings, he said, but others were trapped and "in panic".
He said the gunmen had said they belonged to ISIS, a Sunni group which grew out of al-Qaeda's Iraqi operation.
Later, he told AP he had managed to escape, and that "this crisis ended almost peacefully and no student was hurt as far as I know".
Islamist State in Iraq and the Levant - ISIS
- Jihadist group formed in April 2013 and grew out of al-Qaeda's affiliate organisation in Iraq
- Led by Abu Bakr al-Baghdadi and has an estimated 3,000 to 5,000 fighters
- Mostly active in Iraq and Syria where it has carried out dozens of deadly attacks
- Imposes strict Islamic rule in the areas it controls.
AFP quoted Deputy Interior Minister Adnan al-Assadi as saying that all the students had been "liberated". The militants reportedly left the campus amid gunfire.
At least two security guards were reported killed in the assault. Hospital sources say they have received two bodies - one of a student and the other of a police officer. There is no confirmation.
On Friday, dozens of people died in fighting between Sunni insurgents and government troops in Mosul.
AFP quoted officials as saying the fighting had entered a second day on Saturday, with dozens more insurgents and security personnel killed in clashes.
On Thursday, scores of unidentified militants stormed checkpoints in Samarra.
The advance was eventually halted when helicopter gunships and military reinforcements, including members of Iraq's elite counter-terrorism forces, were sent in.
The army said some 80 insurgents died.