Abstract. The two linearly independent solutions of the three-term recurrence relation of the associated Askey-Wilson polynomials, found by Ismail and Rahman in [22], are slightly modified so as to make it transparent that these functions satisfy a beautiful symmetry property. It essentially means that the geometric and the spectral parameters are interchangeable in these functions. We call the resulting functions the Askey-Wilson functions. Then, we show that by adding bound states (with arbitrary weights) at specific points outside of the continuous spectrum of some instances of the Askey-Wilson difference operator, we can generate functions that satisfy a doubly infinite three-term recursion relation and are also eigenfunctions of q-difference operators of arbitrary orders. Our result provides a discrete analogue of the solutions of the purely differential version of the bispectral problem that were discovered in the pioneering work [8] of Duistermaat and Grünbaum.