In a statement posted on Twitter, IS said the attack in the Sidi Bouzid region was carried out by "two soldiers of the caliphate who attacked two military sites with small arms."
The group, which claimed a March attack on the Bardo National Museum in Tunis that killed 21 foreign tourists and a policeman, said it had "killed or wounded more than 20 soldiers or national guard members" in yesterday's violence.
Three policemen and a jihadist were killed when national guardsmen, acting on a tip-off, tried to ambush two armed men who were allegedly planning attacks, the interior ministry said.
He said two officers were killed in the ensuing shootout, and that the militants fled before killing a third policeman who had been going to work.
Also Read
They were pursued by an elite unit of the national guard, Aroui said.
"One of the terrorists was exterminated, the second was wounded and arrested. He is in a serious condition," he added.
The interior ministry initially blamed the violence on Tunisia's main jihadist group, the Al-Qaeda-linked Okba Ibn Nafaa Brigades, which it has accused of being behind several recent attacks.
Dozens of members of the security forces have been killed since then in jihadist attacks.