Gunmen have attacked and bombed Iraq's largest oil refinery, Baiji, shutting down the facility and killing at least five employees.

Armed men entered the refinery and shot dead two of the engineers, said Abdul Qader al-Saab, the facility's deputy chief.

Then they detonated bombs at one unit, the al-Shamal unit, of the refinery, which represents 25 percent of the refinery's production. In the morning, we came to put out the fire, which erupted as a result of the bombs.

Baiji, located in Salaheddin province north of Baghdad, was badly damaged by a fire. It was one of Iraq’s three most important refineries and at one time was controlled by Sunni insurgents to finance their activities. It produced about 150,000 barrels of oil per day (other sources its capacity is almost double that figure)

Analysts said that while attacks on pipelines are common, targeting a refinery itself is rare.

Ahmed al-Jubouri, the governor of Salaheddin province, told Reuters it's a big loss for the whole country. All Iraqi cities depend on its production..

Officials said the damage was severe and would take at least two weeks to repair.

The attack followed days of protests across Iraq against the corruption of the current regime of Prime Minister Nouri al-Maliki and its perceived failure to provide jobs and basic services, including fuel.

Another oil refinery, in Samawa in southern Iraq was also shut down by fire, but reports indicate this was not due to a terrorist attack.

“Yet another concern is the attack's impact on the country's oil industry as a whole, which only recently has begun to spring back to life. The government has been trying to lure foreign investors to build four new refineries, without much success said Ruba Husari, editor of Iraq Oil Forum, according to the Washington Post. It has been difficult to get international companies to come to construct these. Now you have another element of risk.