Provided is a heterocyclic derivative showing a thyroid hormone β receptor agonist action, which is effective for the prophylaxis or treatment of the diseases relating to the action. A compound represented by the formula [I]:wherein each symbol is as defined in the specification, a pharmacologically acceptable salt thereof, and a medicament containing the compound as an active ingredient.