Twelve coins

This is a more difficult version of the Twelve marbles puzzle.

You have twelve seemingly-identical coins. One of them is fake, but you don’t know which one. All you know is that the fake coin has a different weight than the real coins.

You have a scale you can compare coins with: put any number of coins on each side of the scale, and the scale will lean towards the heavier side.

By using the scale three times at most, determine which coin is fake.