The US leader described IS as " terrorist scum", accusing the group of "targeting and viciously killing, primarily, innocent Christians".BBC reported.
Trump said the US military "executed numerous perfect strikes", while the US Africa Command (Africom) later reported that Thursday's attack was carried out in co-ordination with Nigeria in the Sokoto state.
Nigerian Foreign Minister Yusuf Maitama Tuggar told the BBC it was a "joint operation" targeting "terrorists", and it "has nothing to do with a particular religion".
In his post on Truth Social late on Thursday, Trump said that "under my leadership, our Country will not allow Radical Islamic Terrorism to prosper".
In November, Trump ordered the US military to prepare for action in Nigeria to tackle Islamist militant groups.
He did not say at the time which killings he was referring to - but claims of a genocide against Nigeria's Christians have been circulating in recent months in some right-wing US circles.
Meanwhile, US Defence Secretary Pete Hegseth said on Thursday he was "grateful for Nigerian government support & cooperation".
"Merry Christmas!" he added, writing on X.