The main use of calcium cyanamide is in agriculture as a fertilizer. In contact with water it decomposes and liberates ammonia:
CaCN2+3H2O⟶2NH3+CaCO3