Novak Djokovic was defeated by Andy Murray 2-6, 5-7 in the final match of the Sony Ericsson Open tennis tournament in Miami.