The Iraqi military reported Wednesday that it fended off jihadi militants who were trying to seize control of Iraq's largest oil refinery, which is located in the town of Baiji. 

Iraqi forces killed 40 militants from the Islamic State in Iraq and Syria, or ISIS, according to CNN. Baiji, which is 225 miles north of Baghdad, is the latest region that ISIS is trying to seize in their large-scale battle for control of the country. 

"The situation in Tal Afar, Samarra, and Baiji is under control," military spokesman Gen. Qasem Atta told CNN

He said that Iraq's military is "defeating ISIS in the Baiji area" and that "most of the areas" around the northwest city of Tal Afar have been freed from the militants' control. 

Tal Afar itself was taken over by the militants, who are Sunni Muslim, on Sunday. Many residents of the town, which includes ethnic minority Shiite Turkmen, escaped the fighting by fleeing to Iraq's Kurdish region. 

Keeping control of the oil refinery is of paramount importance to the Iraqi government, as Iraq gains most of its revenue from the refinery's production of oil. Iraq has the world's fourth-largest crude oil reserves, and produces 3.3 million barrels of oil each day. 

Nuri al-Maliki, the prime minister of Iraq, said the Iraqi military "will win," despite major losses, including last week's seizure of the city of Mosul. 

"We absorbed the initial shock of the military operations and now we are on the rebound we will respond and keep the momentum," he said, according to CNN. "What happened was a catastrophe, but not every catastrophe is a defeat."

He blamed the recent surge in terrorism on political powerlessness, but critics blame him and his majority Shia government for increasing sectarian tensions. 

On Tuesday, militants from ISIS also battled the Iraqi military for control of Baquba, which is 60 miles from the capital city of Baghdad. However, the military has not regained control of the city. 

Turkey and India have also gotten involved in the conflict.

Forty-eight Turkish citizens were abducted from the Turkish Consulate in Mosul last week. On Tuesday, the Turkish Foreign Ministry said that efforts are continuing to bring back the consulate staff and the 31 other Turkish citizens who are still being held hostage in Mosul's Geyara district. 

According to India's Ministry of External Affairs, 40 Indian nationals working in Mosul were also kidnapped, and their location is uknown. The kidnapped Indians work for the Traiq Noor Al Huda construction company, which is based in Baghdad. 

In addition to the kidnappings, ISIS militants have claimed to have killed at least 1,700 Shiites since the beginning of the fighting. Hundreds of thousands of people have fled the besieged towns, and fears of a humanitarian crisis have increased. 

Sunni tribes--many of whom support the ISIS militants out of anger at al-Maliki's Shia government--want to see al-Maliki ousted from power. 

President Barack Obama will meet with congressional leaders Wednesday to discuss the crisis, including the question of whether or not the U.S. should intervene.

Currently, Obama has ruled out the option of ground troops, but airstrikes are still on the table. 

Despite the gains of the militants, the Obama administration remains hopeful that Iraq will not fall to the militant fighters. 

"ISF elements protecting Baghdad are assessed to be more loyal to the regime and are composed of mostly Shia who are more likely to resist," the official told CNN. "These factors, plus the fact that they are defending the capital, should motivate the ISF elements in Baghdad to put up a better fight."

While the U.S. has not intervened, Marines and Army troops have beefed up security at the U.S. Embassy in Baghdad. 

Iran is also willing to thwart the advances of ISIS militants.

It was rumored that Iran sent around 500 Revolutionary Guard troops to fight the militants and protect Shiite holy sites. While Iranian President Hassan Rouhani denied the report, he said Iran is willing to help if asked.