And what country can preserve its liberties, if its rulers are not warned from time to time that [the] people preserve the spirit of resistance? Let them take arms…The tree of liberty must be refreshed from time to time, with the blood of patriots and tyrants.
— Thomas Jefferson, letter to Col. William S. Smith, 1787
And often used quote, it is a partial quote, actually. It is taken from a letter Jefferson wrote to William Smith in 1787 in reference to an uprising in Massachusetts after the American Revolution.
Here is an interesting dissection of the historical facts around the letter.
William S. Smith married Abigal Adams and he became son-in-law to John Adams.