The Australian sharemarket ended lower as a 3% surge in energy stocks failed to offset broad losses across the market.