Hamas forces have briefly detained the Palestinian attorney general in the Gaza Strip, officials say.
Hamas routed Fatah forces in the Gaza Strip in mid-June
Ahmed al-Mughani, who is allied with Hamas' rival faction, Fatah, was held in his office in Gaza City.
Mr Mughani is the most senior official to be arrested by Hamas since it seized control of the Gaza Strip in June.
Hamas said Mr Mughani was held because he had taken "dangerous" documents from his office. He rejected the claim, and also refused a demand to resign.
Members of Hamas' Executive Force pushed Mr Mughani out of his office, prodding him in the back with rifles, witnesses were quoted by the Associated Press news agency as saying.
Witnesses said that a human rights activist filming the incident was also arrested.
Mr Mughani was freed shortly afterwards.
"They released me after setting several conditions - not to leave the Gaza Strip, not to make provocations and not to return to my position," Mr Mughani told the AFP news agency.
"I refused to sign these conditions because I take my orders from President Mahmoud Abbas and the Palestinian Authority. What happened is a violation of the law," he said.
Hamas said in a statement that the arrest was made because Mr Mughani had illegally "smuggled very important and dangerous information" from his office.
Mr Mughani returned to Gaza several days ago at Mr Abbas' request, the office of the attorney general said.
The move came in response to a threat by Hamas to sack Mr Mughani and change Gaza's judicial system.
In a separate development, interim Palestinian Prime Minister Salam Fayyad said that Palestinian politics had reached an impasse.
He said the current split, between his Fatah-backed caretaker government and Hamas, meant elections were not feasible.