From first-principles calculations, we have studied the electronic and magnetic structures of compound Na2Ti2Pn2O (Pn=As or Sb), whose crystal structure is a bridge between or a combination of those of high-Tc superconducting cuprates and iron pnictides. We find that in the ground state Na2Ti2As2O is a novel blocked checkerboard antiferromagnetic semiconductor with a small band gap of about 0.15 eV. In contrast, Na2Ti2Sb2O is a bi-collinear antiferromagnetic semimetal, with a small moment of about 0.5 μ(B) around each Ti atom. We show that there is a strong Fermi surface nesting in Na2Ti2Pn2O, and we verify that the blocked checkerboard and bi-collinear antiferromagnetic states both are the spin density waves induced by the Fermi surface nesting. A tetramer structural distortion is found in company with the formation of a blocked checkerboard antiferromagnetic order, in good agreement with the experimentally observed commensurate structural distortion but with space group symmetry retained after the anomaly happens.