During the trial, the judge apparently ordered that Mr Martin be arrested. He is the first foreign journalist to be officially detained by Hamas.
After his arrest, Hamas Interior Ministry spokesman Ehab Ghussein said: "We have confessions that the British journalist committed offences against Palestinian law, and that harms the security of the country."
Mr Martin has briefly been detained in Gaza previously, while reporting for The Times at an anti-Hamas demonstration.
On that occasion, he and a cameraman were reporting on a pro-Fatah demonstration by female students who were attacked by Hamas security forces. They were detained in a police cell before being released.