The 120th sutta of the Majjhimanikāya.
A monk who possesses faith (saddhā), virtue (sīla), learning (suta), liberality (cāga), and wisdom (paññā), if he cultivates and develops them, can be reborn in any condition or world he may desire; he can even, thereby, win nibbāna (M.iii.99 ff).
The sutta contains a long list of deva and Brahma worlds.