* Nigerian militants planned raids on markets -source
* Arrests highlight cross-border threat from Nigerian conflict
NIAMEY, Feb 17 (Reuters) - Niger has arrested about 20 Boko Haram Islamist militants from neighbouring Nigeria who are suspected of planning attacks in Niger's south east, Nigerien security officials said on Monday.
The alleged plot to strike Diffa, a Nigerien town that borders Nigeria's Borno state, highlights the cross-border threats following a Nigerian army offensive against militants that has pushed thousands of refugees and some insurgents across the porous border into Niger.
Niger's army chief General Seyni Garba told troops in Mali during a visit that the militants were preparing attacks on markets and other gathering places in retaliation for Niger's stance against extremists in the region.
Niger has emerged as a firm ally of France and the United States in the fight against al Qaeda-linked groups in the Sahel. It is a base for French and U.S. surveillance drones and Niamey has deployed 650 troops to neighbouring Mali to back a French-led campaign against Islamists there.
"The bloodbath planned by the terrorist organization to punish our country has fortunately been avoided," Garba was quoted as saying in Monday's edition of Le Sahel, a Niger state-owned newspaper.
Garba, speaking while visiting Nigerien troops in the U.N. peacekeeping mission in Mali, said the arrests took place in Diffa. He did not say how many militants were held or when the detentions took place.
A Nigerien security official told Reuters that 20 Boko Haram militants, all Nigerians, were arrested in the sweep late last month.
"It was a cell that was planning attacks on Diffa and the surrounding areas," the officer said, asking not to be named.
Another military officer said the cell was identified by Niger's anti-terrorism unit and placed under surveillance as soon as they entered Niger's territory.
While much of the Western security focus is on Niger's vast northern desert zone that borders Mali, Algeria, Libya and Chad, officials say the spillover from the conflict in northern Nigeria is equally worrying for the Niamey government.
(Reporting by Abdoulaye Massalaki; Writing by Bate Felix; Editing by David Lewis and Catherine Evans)