This is the national and state flag of San Marino, a tiny country of only 61 square kilometers, and which is entirely surrounded on all sides by Italy. It has a population of roughly 27,000 people.
50% of San Marino's GDP is from tourism, however it also has its own currency and postage stamps. In fact, San Marino has a booming trade in stamps, and most of San Marino's postage stamps (which are only valid for use inside the country) are sold to foriegn stamp collectors. Other key industries include banking, electronics, ceramics, wine and cheese. San Marino has strong economic ties with Italy.
A close-up of the flag's crest is shown below.
The San Marino national flag is sometimes also shown without the crest (as shown below), and this also constitutes the civil ensign. However, as San Marino is completely landlocked, and does not possess any significant bodies of water, you are unlikely to see any ship sailing under this flag.
You can read more about San Marino on Wikipedia.
Technical clue provided by Perl Training Australia