Catalysis of the transfer of a solute or solutes from one side of a membrane to the other according to the reaction: ATP + H2O + phosphonate(out) = ADP + phosphate + phosphonate(in). A phosphonate is any salt, anion, or ester of phosphonic acid (HPO(OH)2).