This phrase originates from Stephen Decatur, 19th century naval commander, in the form "Our country! In her intercourse with foreign nations, may she always be in the right; but our country, right or wrong", which he said in a toast given at a banquet in Norfolk, Virginia in 1816. It is also the name of a one-man theater show about Decatur by a William Willis.

http://www.infotoday.com/searcher/jun02/voice.htm
http://www.zweb.com/parpro/Decatur.html