Ongoing battle ... Members of the Iraqi security forces take position during fighting with anti-government fighters. Picture: Azhar ShallalSource: AFP

MILITANTS stormed a university in Iraq’s restive Anbar province Saturday, briefly taking dozens of students hostage before withdrawing from the school amid gunfire, officials and witnesses said.

The attack on Anbar University comes as Islamic extremists and other anti-government militias have held parts of the nearby provincial capital of Ramadi and the city of Fallujah since December amid rising tensions between Sunni Muslims and the Shiite-led government in Baghdad. While shelling and gunbattles continue between the militants and government-allied forces, the school largely has been left alone while civilians fled the violence.

That changed early Saturday morning as the gunmen killed three police officers on guard at the university’s gate, a police and a military official said. The gunmen then detained dozens of students inside a university dorm, the officials said.

Rising tensions ... members of the Iraqi security forces take position during a conflict with anti-government fighters on May 21, 2014 in the city of Ramadi, in the Anbar province. Picture: Azhar ShallalSource: AFP

Ahmed al-Mehamdi, a student who was taken hostage, said he awoke to the crackle of gunfire, looked out the window and saw armed men dressed in black racing across the campus. Minutes later, the gunmen entered the dormitory and ordered everybody to stay in their rooms while taking others away, he said.

The Shiite students at the school were terrified, al-Mehamdi said, as the gunmen identified themselves as belonging to an al-Qaida splinter group known as the Islamic State of Iraq and the Levant. The Sunni terror group, fighting in Syria with other rebels trying to topple President Bashar Assad, is known for massive, bloody attacks in Iraq as well often targeting Shiites that they view as heretics.

The Islamic State did not immediately claim the attack on the school, which says it has more than 10,000 students, making it one of the country’s largest.

Several hours later, gunmen left the university under unclear circumstances. Students then boarded buses provided by the local government to flee the school, though gunfire erupted as security forces attacked retreating militants, police said.

Deadly attack ... a member of the Iraqi security forces stands outside a burnt house in the city of Ramadi, west of Baghdad. Picture: Azhar ShallalSource: AFP

“We thank God that this crisis ended almost peacefully and no student was hurt as far as I know,” Mr al-Mehamdi said by mobile phone from inside a bus that took him to safety.

Security officials said authorities wanted to wait for bomb disposal experts before entering any building on campus out of fears that the fleeing gunmen planted explosives.

Iraq is currently grappling with its worst surge in violence since the sectarian bloodletting of 2006 and 2007, when the country was pushed to the brink of civil war despite the presence of tens of thousands of US troops.

The latest violence has been fueled by Sunni Muslim anger at the Shiite-led government in Baghdad, as well as the civil war in neighboring Syria. The Islamic State has carried out scores of deadly attacks on both sides of the border and imposed a brutal form of Islamic rule in territories under its control.

Those attacks include a coordinated assault April 21 on a private Shiite college in Baghdad that killed four police officers and one teacher.

Al-Qaida-linked fighters and their allies seized Fallujah and parts of Ramadi in late December after authorities dismantled a protest camp of Sunnis angry at what they consider their second-class treatment by the Shiite-led government. Fearful of setting off violence, security forces withdrew from the area, allowing militants to seize the cities. In April 2013, a similar dismantling of a Sunni protest camp in Hawija sparked violent clashes and set off the current upsurge in killing.

Rebel stronghold ... Iraqi Security forces prepare to attack al-Qaida positions in Ramadi in February. Militants, many from the al-Qaida-breakaway group Islamic State, overran Fallujah and parts of Ramadi at the beginning of 2014.Source: AP

The government and its tribal allies are besieging the rebel-held areas, with fighting reported daily. Tens of thousands have fled the violence.

Saturday’s attack is the third major operation by militants in three days, following heavy fighting and suicide bombings in northern Iraq on Friday and a major assault on the city of Samarra on Thursday.

The militants from the Islamic State of Iraq and the Levant group infiltrated the university from the nearby Al-Tasha area, killed its guards, and blew up the bridge leading to its main gate, police said.

An AFP journalist said that security forces have cordoned off the campus.

The attack came a day after violence, including heavy fighting between militants and security forces and twin suicide bombings targeting a minority group, killed at least 36 people in the northern province of Nineveh.

And on Thursday, militants seized multiple areas of Samarra in a major assault that was only repelled after house-to-house fighting and helicopter strikes.

Violence is running at its highest levels since 2006-2007, when tens of thousands were killed in sectarian conflict between Iraq’s Shi’ite majority and Sunni Arab minority.

Officials blame external factors for the rise in bloodshed, particularly the civil war in neighbouring Syria.

But analysts say widespread Sunni Arab anger with the Shi’ite-led government has also been a major factor.

News.com.au's Privacy Policy includes important information about our collection, use and disclosure of your personal information (including to provide you with targeted content and advertising based on your online activities). It explains that if you do not provide us with information we have requested from you, we may not be able to provide you with the goods and services you require. It also explains how you can access or seek correction of your personal information, how you can complain about a breach of the Australian Privacy Principles and how we will deal with a complaint of that nature.

A NOTE ABOUT RELEVANT ADVERTISING: We collect information about the content (including ads) you use across this site and use it to make both advertising and content more relevant to you on our network and other sites.