Hamas gunmen captured a Fatah security headquarters building in northern Gaza Tuesday after battling for several hours using mortar shells and grenades, as factional fighting between the rival Palestinian parties worsened.