The future of centimetre and metre-wave astronomy lies with the Square Kilometre Array (SKA), a telescope under development by a consortium of 17 countries that will be 50 times more sensitive than any existing radio facility. Most of the key science for the SKA will be addressed through large-area imaging of the Universe at frequencies from a few hundred MHz to a few GHz. The Australian SKA Pathfinder (ASKAP) is a technology demonstrator aimed in the mid-frequency range, and achieves instantaneous wide-area imaging through the development and deployment of phased-array feed systems on parabolic reflectors. The large field-of-view makes ASKAP an unprecedented synoptic telescope that will make substantial advances in SKA key science. ASKAP will be located at the Murchison Radio Observatory in inland Western Australia, one of the most radio-quiet locations on the Earth and one of two sites selected by the international community as a potential location for the SKA. In this paper, we outline an ambitious science program for ASKAP, examining key science such as understanding the evolution, formation and population of galaxies including our own, understanding the magnetic Universe, revealing the transient radio sky and searching for gravitational waves.