Iraq's prime minister says winning the ongoing battle over control of an oil refinery town north of Baghdad is the key to defeating the Islamic State group in Iraq.

The military retook the town of Beiji from the extremist group in November, but government forces there have come under mounting pressure in recent weeks from the militants who, according to a top commander familiar with the situation, are now in control of 50 percent of the town and the oil refinery to the north.

Prime Minister Haider al-Abadi visited the area on Monday, when he spoke to military and Shiite militia commanders. His comments were broadcast Tuesday by state television.

"Victory at Beiji is crucial to ending Daesh's presence in Iraq," he said, using the Arabic acronym for the IS.