In most national elections there is usually the option for voters to cast their ballot in foreign consulates. But as far as I can tell this is usually a mere formality as very few voters ever make use of that privilege and the "foreign" votes don't really affect anything. 

But has there been an election where the foreign vote has had a deciding effect? Here "deciding" means that the vote margin among foreign votes is larger than (and opposite to) the margin of all in-country votes.