At least six militants were killed in the raid on Friday, the ministry said in a statement on Saturday.
The insurgents attacked Diffa in the late afternoon, riding in about 15 vehicles. After intense fighting, they were pushed back by security forces,
The Boko Haram insurgency broke out in northeastern Nigeria in 2000, but violence frequently spills over into neighbouring Chad, Niger and Cameroon.
In December, an attack blamed on Boko Haram killed 28 people and burned 800 homes in Diffa region.