A 62 element MRI-compatible linear phased array was designed and constructed to investigate the feasibility of using transrectal ultrasound for the thermal therapeutic treatment of prostate cancer and benign prostatic hyperplasia. An aperiodic design technique developed in a previous study was used in the design of this array, which resulted in reduced grating lobe levels by using an optimized random distribution of unequally sized elements. The element sizes used in this array were selected to be favorable for both grating lobe levels as determined by array aperiodicity and array efficiency as determined by width to thickness ratios. The heating capabilities and MRI compatibility of the array were tested with in vivo rabbit thigh muscle heating experiments using MRI temperature monitoring. The array produced therapeutic temperature elevations in vivo at depths of 3-6 cm and axial locations up to 3 cm off the central axis and increased the size of the heated volume with electronic scanning of a single focus. The ability of this array to be used for ultrasound surgery was demonstrated by creating necrosed tissue lesions in vivo using short high-power sonications. The ability of the array to be used for hyperthermia was demonstrated by inducing therapeutic temperature elevations for longer exposures. Based on the acoustic and heating performance of this array, it has the potential to be clinically useful for delivering thermal therapies to the prostate and other target volumes close to body cavities.