(Adds context, detail)
By Julia Payne
ABUJA, March 26 (Reuters) - Nigeria's military has detained two Al Jazeera journalists in the northeast city of Maiduguri since Tuesday, the television broadcaster said on Thursday, days ahead of the country's general elections.
Al Jazeera said the journalists, Ahmed Idris and Ali Mustafa, were being kept in their hotel rooms until further notice. Their camera equipment has been confiscated.
It added that the two journalists had been accredited by the electoral authorities with "clearance to report from anywhere."
Northeastern Nigeria was effectively declared off limits to journalists in 2013 after the government imposed emergency rule in Yobe, Adamawa and Borno, the three states worst affected by Islamist jihadis Boko Haram. Maiduguri is the capital of Borno state, the heartland of the insurgency.
Nigeria's defense headquarters said on Wednesday the two reporters were "restrained to their hotel" in the Borno state capital after they had been detained for "loitering" in areas where military operations against Boko Haram were under way.
They had also been observed in Yobe state, it said, adding it had previously cautioned journalists against unauthorized movements in areas with military operations.
With the general elections set for Saturday, the country has tightened security by closing land and sea borders. Roads will be shut on election day for all but authorized vehicles.
The presidential poll is expected to be the most hotly contested since the end of military rule in 1999. Incumbent Goodluck Jonathan of the People's Democratic Party is running against former military ruler Muhammadu Buhari of the All Progressives Congress. (Editing by Tom Heneghan)