We study an exactly solvable toric code type of Hamiltonian in three dimensions, defined on the diamond lattice with spin-1/2 degrees of freedom at each site. The Hamiltonian is a sum of mutually commuting plaquette operators B p , all of which have eigenvalue +1 in the ground state. The excitations are "fluxes," which are plaquettes with B p = −1. Due to certain local kinematic constraints, fluxes form loops. The elementary flux-loop excitations are fermions, in contrast to other solvable spin-1/2 models in three dimensions, where the excitations are bosons. Furthermore, the flux loops braid nontrivially, giving rise to Abelian anyonlike statistics.