The end justifies the means. (Thanks rahul.)
This proverbial (and controversial) observation dates from ancient times, but in English it was first recorded only in 1583, in the Niccolo Machiavelli's book The Prince.
See The Free Dictionary, and the discussion about its meaning.