Vectorial Boolean functions are used in cryptography, in particular in block ciphers. An important condition on these functions is a high resistance to the differential and linear cryptanalyses, which are the main attacks on block ciphers. The functions which possess the best resistance to the differential attack are called almost perfect nonlinear (APN). Almost bent (AB) functions are those mappings which oppose an optimum resistance to both linear and differential attacks. Up to this work only a few classes of APN and AB functions had been known and all these classes happened to be extended affine equivalent (EA-equivalent) to power functions. In this work we constructed the first classes of APN and AB polynomials EA-inequivalent to power mappings by using the equivalence relation (which we call CCZ-equivalence). Moreover we show that the number of different classes of AB polynomials EA-inequivalent to power functions is infinite. One of the constructed functions serves as a counterexample for a conjecture about nonexistence of AB functions EA-inequivalent to permutations.