© 2015 The Authors. We report the discovery of a new 21-cm HI absorption system using commissioning data from the Boolardy Engineering Test Array of the Australian Square Kilometre Array Pathfinder (ASKAP). Using the 711.5-1015.5 MHz band of ASKAP we were able to conduct a blind search for the 21-cm line in a continuous redshift range between z = 0.4 and 1.0, which has, until now, remained largely unexplored. The absorption line is detected at z = 0.44 towards the GHz-peaked spectrum radio source PKS B1740-517 and demonstrates ASKAP's excellent capability for performing a future wide-field survey for HI absorption at these redshifts. Optical spectroscopy and imaging using the Gemini-South telescope indicates that the HI gas is intrinsic to the host galaxy of the radio source. The narrow [OIII] emission lines show clear double-peaked structure, indicating either large-scale outflow or rotation of the ionized gas. Archival data from the XMM-Newton satellite exhibit an absorbed X-ray spectrum that is consistent with a high column density obscuring medium around the active galactic nucleus. The HI absorption profile is complex, with four distinct components ranging in width from 5 to 300 km s-1 and fractional depths from 0.2 to 20 per cent. In addition to systemic HI gas, in a circumnuclear disc or ring structure aligned with the radio jet, we find evidence for a possible broad outflow of neutral gas moving at a radial velocity of v ~ 300 km s-1. We infer that the expanding young radio source (tage ≈ 2500 yr) is cocooned within a dense medium and may be driving circumnuclear neutral gas in an outflow of ~1 M o˙ yr-1.