All 10 ISIL fighters who entered the Ain al-Assad military base in Anbar province on Saturday were killed, the source told Al Jazeera.
An Iraqi defence ministry spokesman said that eight of them were killed by soldiers, and that two had managed to blow themselves up.
The attackers were killed before they reached any facilities under the control of the US military, according to army sources.
“They reached some important Iraqi offices inside the base, one of them the telecommunications office, before they were killed,” Al Jazeera’s Waleed Ibrahim, reporting from Baghdad, said.
Iraqi forces launched an offensive last week to retake Anbar province. Sixty to 70 percent of the strategically important province remains under the control of ISIL.
Football stadium blast
The attack came a day after a suicide bomber blew himself up at a football stadium in Iskandariya, south of the capital Baghdad, killing at least 30 people and injuring 95 others.
ISIL, also known as ISIS, later claimed responsibility for the attack.
Al Jazeera’s Jane Arraf, reporting from Baghdad, said there had been an escalation of suicide bombings in areas outside ISIL’s control.
“According to Iraqi and US military sources, as ISIL loses the ability to launch large-scale attacks to gain territory, they are focusing on small attacks,” she said.
At least 60 people were killed earlier this month in an attack claimed by the group 80km further south of Baghdad, in Hilla, when an explosives-laden fuel tanker slammed into a government checkpoint.