“Patriotism is supporting your country all the time, and your government when it deserves it”

Mark Twain (the pen name of Samuel Langhorne Clemens, 1835-1910) wrote in the March 1905 The North American Review, in “The Czar’s Soliloquy”:
 
“There are twenty-five million families in Russia. There is a man-child at every mother’s knee. If these were twenty-five million patriotic mothers, they would teach these man-children daily, saying: ‘Remember this, take it to heart, live by it, die for it if necessary: that our patriotism is medieval, outworn, obsolete, that the modern patriotism, the true patriotism, the only rational patriotism, is loyalty to the nation ALL the time, loyalty to the government when it deserves it.”
   
“Patriotism is supporting your country all of the time, and your government when it deserves it” is a slightly different form of the quotation that has been popular since about 2004.
 
 
Google Books
March 1905, The North American Review, “The Czar’s Soliloquy” by Mark Twain, pg. 324:
There are twenty-five million families in Russia. There is a man-child at every mother’s knee. If these were twenty-five million patriotic mothers, they would teach these man-children daily, saying: “Remember this, take it to heart, live by it, die for it if necessary: that our patriotism is medieval, outworn, obsolete, that the modern patriotism, the true patriotism, the only rational patriotism, is loyalty to the nation ALL the time, loyalty to the government when it deserves it.”
 
Google Books
Mark Twain at Your Fingertips
Compiled and edited by Caroline Thomas Harnsberger
New York, NY: Cloud, Inc.: Beechhurst Press
1948
Pg. 351:
... the modern patriotism, the true patriotism, the only rational patriotism is loyalty to the nation all the time, loyalty to the government when it deserves it.
P. 324 — The North American Review, March, 1905, “The Czar’s Soliloquy”
 
Google Books
Bush Unplugged:
The true patriot’s guide to George W. Bush

By Mike Umile
True Patriots’ Press
2004
Pg. I:
“Patriotism is supporting your country all of the time, and your government when it deserves it. ” - Unknown Patriot
 
Google Books
The 3Rs Of George W. Bush:
Reasons For Rejecting The Re-election Of PresidentGeorge W. Bush

By Lewis B. Smith
Victoria, BC: Trafford Publishing
2004
Pg. 45:
David C. Mac Michael, former senior estimate officer for the CIA, tells us Mark Twain’s definition of patriotism. “Patriotism is supporting your country all the time and your government when it deserves it.” Perhaps we can better learn to practice Mark Twain’s definition.
 
20 January 2004, The Berkshire Eagle (Pittsfield, MA), “Latest in a line of unjustified wars”:
As Mark Twain said, “Patriotism is supporting your country all the time, and your government when it deserves it.”
 
Examiner.com
Mark Twain the Revolutionary “Loyalty to the government when it deserves it.”
MAY 5, 2010 BY: GENE BOWKER
(...)
The quote has become a popular one on Twitter and other social networking sites for people on both ends of the political spectrum. The “tea-party” uses it for why we should resist “tyranny” and so do the groups on the far left.
 
The article that it came from was dealing with the Russian Czarist government before the Revolution.