The Heun-Askey-Wilson algebra is introduced through generators {X, W} and relations. These relations can be understood as an extension of the usual Askey-Wilson ones. A central element is given, and a canonical form of the Heun-Askey-Wilson algebra is presented. A homomorphism from the Heun-Askey-Wilson algebra to the Askey-Wilson one is identified. On the vector space of the polynomials in the variable x = z + z −1 , the Heun operator of Askey-Wilson type realizing W can be characterized as the most general second order q-difference operator in the variable z that maps polynomials of degree n in x = z + z −1 into polynomials of degree n + 1.1 2 PASCAL BASEILHAC, SATOSHI TSUJIMOTO, LUC VINET, AND ALEXEI ZHEDANOV operator and shown to be identical to the AHO connected to the big q-Jacobi polynomials. A special case readily seen to be the AHO of the little q-Jacobi polynomials has been called the little q-Heun operator. The big and little q-Heun operators were recognized to be two of the q-Heun operators introduced by Takemura [15] as degenerations of the Ruijenaars-van Diejen operators [14,4] thereby adding to the understanding of these topics. We now follow up with possibly the most important case: the q-analog of the Heun equation on the Askey grid.The tridiagonalization method has been used to inform the theory of higher polynomials (in the Askey scheme) from the lower ones [10,11,6]. The basic idea is to built the defining operator of the higher polynomials as special bilinear combinations of the bispectral operators of the lower polynomials. This splits the parameters of the higher polynomials in two classes: on the one hand, the set of parameters pertaining to the lower polynomials and on the other, the parameters entering the tridiagonalization. From an algebraic perspective, such special tridiagonalizations effect embeddings of the quadratic algebra associated to the higher polynomials into the algebra of the lower system. This is done by replacing the defining operator of the lower polynomials by the tridiagonalized one. In the q-sector, one has the Askey-Wilson (AW) algebra [19] at the highest level. Obviously the general tridiagonalization that yields AHOs takes one outside the framework of orthogonal polynomials. It is of interest to provide an algebraic picture of this situation and to unravel the structure that extends the AW algebra to an HAW algebra. This will also be done here.The outline of this paper is as follows. In Section 2, we introduce the Heun-Askey-Wilson (HAW) algebra. This algebra generalizes the Askey-Wilson algebra, whose defining relations can be recovered for certain choices of the structure constants. A central element is constructed. Also, for generic values of the deformation parameter q, a canonical presentation of the HAW algebra is exhibited. In Section 3, we study the relation between the HAW and the Askey-Wilson algebras. An explicit homomorphism from the HAW algebra to the Askey-Wilson one is given, inducing a new presentation that is closely related with the "Z 3 symmetri...