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 now only a few classes of APN and AB functions have been known and all these classes happened to be extended affine equivalent (EA-equivalent) to power functions. In this work we construct the first classes of APN and AB polynomials EA-inequivalent to power mappings by using the equivalence relation (which we call CCZ-equivalence) presented in the paper of Carlet, Charpin and Zinoviev in 1998. 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. Further we show that applying only EA and inverse transformations on an AB permutation $F$ it is possible to construct AB polynomials EA-inequivalent to both functions $F$ and $F^{-1}$.