"You're in big trouble now," said one of four unsmiling members of an armed group in military-style uniforms, hard men who pressed in against me and looked as though they meant business.
I imagined being banged up in some dark, dank overcrowded cell - all because of a postcard.
My predicament had its origins an hour earlier as I flicked through postcards in the lobby shop of a hotel in Gaborone, Botswana.
Just back from the famed game parks of Okavango and Chobe, I was spending a couple of days in the southern African nation's capital.
Among the postcards was one I'd also seen in several souvenir shops, a picture of democratic Botswana's parliament.
It's one of the country's most imposing buildings. Staff told me it was only a few minutes' stroll from the hotel. I decided to take a few pictures of it.
The men appeared moments after I lifted my camera.
"You're breaking the law," said one.
"You're a spy," said a second.
"You're working for enemies of Botswana," said a third.
I knew I'd broken no law. Pictures of the same building were freely available on postcards and in books.
It had been illegal to photograph government buildings during neighbouring South Africa's apartheid era when Botswana was attacked several times by Pretoria's forces for harbouring anti-racist dissidents.
But times have changed. These days, welcoming Botswana has no enemies and tourism - anchored by a network of game parks - is an important industry.
I pointed this out to my captors and babbled about how much I'd enjoyed Botswana.
They remained impassive but I recalled a travel tip I was once given and have used successfully in various poor countries: even if you don't smoke (and I don't), carry a pack of cigarettes as a social lubricant.
I took a cigarette from the pack I carried and asked if anyone had a light. One of the men produced a lighter. I offered cigarettes to everyone.
Two helped themselves to three cigarettes each.
"For later," said one.
"For my friends," said his beaming colleague.
Soon we were sitting under a tree and chatting.
"We'll let you off this time because you are our friend," said the leader.
"But you've broken the law."
I decided against arguing. I was clearly the victim of a shakedown though my new friends were genuinely guarding the building.
However, it's often difficult to know whether you've inadvertently broken a real law - or whether you're being scammed.
Travel agents advise against making a fuss if only a small sum is involved.
Low-paid soldiers often harass travellers in African countries, claiming some or other legal infringement can be settled by paying an instant fine (for which no receipt is issued).
They also target foreigners driving rented vehicles, claiming these are defective in some way. Again, a spurious on-the-spot fine is imposed - an often astronomical sum which can be negotiated down to a pittance.
Corrupt police in provincial Thailand and the Philippines occasionally point to real or fake infringements, suggesting a "fine" be paid directly to them. However, these incidents are extremely rare and very few travellers encounter them.
Travel consultant Melanie Wynne of Adelaide's Phil Hoffman Travel recalls being frogmarched across a Moscow street for jaywalking and "not crossing at a proper intersection".
These are genuine offences in Russia - but the cop was prepared to settle for an "instant fine".
She warns against carrying fake designer handbags in France where people have been arrested for toting such items. It makes sense to read as much as you can about the laws and customs of countries you'll be visiting. But, say travel professionals, many people don't bother.
"Behaviour you think perfectly acceptable and which is normal in some places is not acceptable in other places," notes Daniel Alexander, national operations manager at Melbourne's Navigator Travel Management.
A little advance reading can prevent arrest and possible imprisonment. An example: medications containing codeine are banned in Greece (though Customs sometimes turn a blind eye). Several countries ban the wearing of military-style clothing. Most Muslim nations have strict rules about alcohol. In some it's banned, in others it's tolerated on a limited scale - and in others it's freely and legally available.
Rules about public affection vary, too. In some Muslim nations, men and women holding hands can be arrested. In others (as British visitors discovered in the United Arab Emirates' superficially easy-going Dubai) arrest and prosecution can follow public displays of affection.
Clothing rules differ, too, between Muslim nations - with Iran, where increasing numbers of Australians have in recent years been lured by gorgeous antiquities, at the stricter end of the scale. Ankle-length black garb is customary attire for women. To rebel because you don't dress this way at home is to court arrest. In any case, says Pamela Ryan, director of Melbourne's Capricorn Travel, "it's courteous for women to cover up as much as possible and wear a scarf".
Like other travel agents, Navigator's Alexander recommends people read as much as possible about places they plan to visit - and particularly suggests they look at information on the Department of Foreign Affairs and Trade website, www.smartraveller.gov.au.
Laws may be toughened or relaxed - so it's sensible to read something current. For instance, Singapore retains its reputation for draconian laws to prevent aberrant behaviour. Souvenir shops still sell T-shirts labelling the destination a "fine city" on the front - with a list of fines and offences on the back. Jaywalking is not allowed - but today's Singaporeans ignore this and several other rules with impunity.
Photography can be a headache in many countries. In some, certain public buildings (such as defence ministries or military bases) must not be photographed. Bans in others extend to bridges or airports. An impromptu stop to take a picture of an historic bridge could make you a law-breaker. It's as well to ask in advance.
While Customs in many countries confiscate pornography, in dictatorships seemingly innocuous newspapers or magazines may also be taken away. And Thailand, the preferred holiday destination of many Australians, has the world's strictest lese majeste (an offence to a head of state) rules. It's illegal to speak ill of the monarch, who is widely revered, or other members of the royal family. People are sent to prison for doing so.
Flippant comments about royalty are commonplace in European monarchies - but not in Thailand. Overheard comments may well be reported to authorities.
Wherever you're travelling, it pays to find out much as possible about a country before visiting.